Skip to content

v2.0.0

Choose a tag to compare

@kettanaito kettanaito released this 16 Feb 16:12

Breaking changes

  • The call signature of until has changed to:
function until<ErrorType, DataType>(promise: () => Promise<DataType>):  Promise<{ error: ErrorType, data: null } | { error: null, data: DataType}>

On practice, this means the following:

-const [error, data] = await until(() => action())
+const { error, data } = await until(() => action())
  • The order of the generics until accepts also changed:
-function until<DataType, ErrorType>() {}
+function until<ErrorType, DataType>(){}