question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not understanding the purpose of redux-actions...

See original GitHub issue

Apologies, 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:closed
  • Created 7 years ago
  • Comments:6

github_iconTop GitHub Comments

2reactions
gouegdcommented, Mar 31, 2017

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.

0reactions
joetideecommented, Feb 15, 2017

So if you use redux-actions, you cannot perform async actions?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found