Skip to content

Instantly share code, notes, and snippets.

@erikras
Created March 30, 2018 15:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikras/a944557d23e4d73d9d79c227ca1b08bf to your computer and use it in GitHub Desktop.
Save erikras/a944557d23e4d73d9d79c227ca1b08bf to your computer and use it in GitHub Desktop.
<MakeAsyncFunction
listener={promiseListener}
start="START_ACTION_TYPE" // the type of action to dispatch when this function is called
resolve="RESOLVE_ACTION_TYPE" // the type of action that will resolve the promise
reject="REJECT_ACTION_TYPE" // the type of action that will reject the promise
>{asyncFunc => (
<SomeFormLibrary onSubmit={asyncFunc}>
...
<button type="submit">Submit</button>
</SomeFormLibrary>
)}</MakeAsyncFunction>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment