redux-action-creator | Reduce boilerplate code in your action creators | State Container library
kandi X-RAY | redux-action-creator Summary
kandi X-RAY | redux-action-creator Summary
Reduce boilerplate code in your Redux action creators and types with support for normalizr, universal JavaScript, and Redux-first Router.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of redux-action-creator
redux-action-creator Key Features
redux-action-creator Examples and Code Snippets
Community Discussions
Trending Discussions on redux-action-creator
QUESTION
I am trying to grasp how to return a promise from a Redux Action Creator. I have read these two articles, but are none the wiser. Maybe I'm just daft. ;)
https://redux.js.org/advanced/middleware https://medium.com/collaborne-engineering/returning-promises-from-redux-action-creators-3035f34fa74b
- My component calls the action called
startCreateNote()
- The action calls the database API
- The database operation finishes and resolves an object {newlyCreated-id, reduxStoreObject}
- the Action Creator is dispatched
- Now I wish to wait for the Redux Action Creator to resolve before proceeding
- Show toaster after Action Creator has resolved
See code below.
...ANSWER
Answered 2019-Jul-08 at 16:28From what I understand the (probably) easiest way to make the action creator return a promise is by using one of several asynchronous-operations libraries such as:
- redux-saga
- redux-thunk
- redux-observable
- redux-promise
- redux-loop
- redux-ship
- redux-logic
- redux-effects
- redux-cycles
- redux-side-effects
I found more information here: https://decembersoft.com/posts/what-is-the-right-way-to-do-asynchronous-operations-in-redux/#redux-saga
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install redux-action-creator
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page