Skip to content

Instantly share code, notes, and snippets.

@XaveScor
Last active June 28, 2017 14:33
Show Gist options
  • Save XaveScor/aa93728ce0adfb1cafa8828c32974ad5 to your computer and use it in GitHub Desktop.
Save XaveScor/aa93728ce0adfb1cafa8828c32974ad5 to your computer and use it in GitHub Desktop.
flow bug
type DataType =
| {'grant_type': 'silent'}
| {'grant_type': 'password', 'username': string, 'password': string}
type BodyType = {
'client_id': string,
'client_secret': string,
'scope': string,
} & DataType
...
request(data: DataType): Promise<string> {
...
const body: BodyType = { // wrong here
...data,
'client_id': this.receivedURL.clientId,
'client_secret': this.receivedURL.clientSecret,
'scope': this.receivedURL.scope,
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment