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.

Calling async actions from other async actions

See original GitHub issue

Hey, as in the subject. Is it possible to call async action from within other async action?

In Redux + Redux Thunk, it’s possible to do something like:

export const asyncAction = (args: Args): ThunkResult<void> => async (
  dispatch,
  getState
) => {
  try {
    await dispatch(anotherAsyncAction());
  } catch (error) {
    /* ... */
  }
};

But it doesn’t seem to be possible in ReactTracked. Is it?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
lukejagodzinskicommented, Feb 20, 2020

@dai-shi hey, sorry had to postpone moving to react-tracked as other things are more important but yeah I will use your approach. Actually I wanted to avoid that but it will just be a little bit more rewrite but code will still be clean and readable. Thanks! 😃 Will close this issue

0reactions
dai-shicommented, Feb 20, 2020

Still having any issues?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Redux Fundamentals, Part 6: Async Logic and Data Fetching
Just like with a normal action, we first need to handle a user event in the application, such as a click on a...
Read more >
How can I make a function Async in reactjs which calls ...
I am using react, with redux for state management. In my UI I have a button which when clicked it calls a function...
Read more >
Async actions
Async actions · Fetching data for display alone isn't sufficient for most applications. · Like promiseFn , a deferFn is a function that...
Read more >
async function - JavaScript - MDN Web Docs - Mozilla
An async function will return a different reference, whereas Promise.resolve returns the same reference if the given value is a promise. It can ......
Read more >
How to handle Async operations with Redux - Imaginary Cloud
So, where should you apply async calls in Redux? The Actions should be the immediate answer, but the basic implementation of actions is...
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