Skip to content

Instantly share code, notes, and snippets.

@AllGistsEqual
Created April 25, 2021 21:03
Show Gist options
  • Save AllGistsEqual/4725f73e737b464ff763e65d54de23f6 to your computer and use it in GitHub Desktop.
Save AllGistsEqual/4725f73e737b464ff763e65d54de23f6 to your computer and use it in GitHub Desktop.
const mockSuccess = (value: SuccessValue): Promise<SuccessValue> => {
return new Promise(resolve => {
setTimeout(() => resolve(value), 2000)
})
}
const mockFailure = (value: FailureValue): Promise<FailureValue> => {
return new Promise((resolve, reject) => {
setTimeout(() => reject(value), 2000)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment