Not understanding the purpose of redux-actions...
See original GitHub issueApologies, but it’s not obvious to me what the redux-actions package does. For example, I currnelty create my actions like this:
export function doSomething(id) {
return { type: 'DO_SOMETHING', payload: id }
}
So how does this package improve on this?
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Troubleshooting | Redux
Sometimes, you are trying to dispatch an action, but your view does not update. Why does this happen? There may be several reasons...
Read more >redux action "is not a function" when dispatched from component
The reason. We have to import the default export when rendering the component in order to use the redux connect() higher order function...
Read more >Understanding Redux: A tutorial with examples
In this tutorial, we'll show you what Redux is, why you should use it, and how it works. We'll demo using a simple...
Read more >What is Redux? Store, Actions, and Reducers Explained for ...
Why Use Redux? ... Well, an application has its state, which can be a combination of the states of its internal components. Let's...
Read more >Redux without State. WHY? | by Kevin Ghadyani - ITNEXT
In the same way you don't need Redux to use Redux-Observable, you also don't need state or reducers to use the action system...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
An action is just a JS object with a
type
property and perhaps others. So there’s no “async action” but you can create actions asynchronously.You can do it manually or with the helpers that @yangmillstheory noted above.
redux-thunk
lets you create actions based on other actions.redux-promise
lets you create actions based on promises.redux-saga
works with generators and can replace both libs above, with more powerful abstractions to handle async events, but in a way that most JS devs will need some time to understand properly.So if you use redux-actions, you cannot perform async actions?