Put in loop
See original GitHub issueHow to call put effect in loop correctly?
So i wanna do something like this:
function* dispatchAll (data) {
yield put({
type: 'TYPE',
payload: data
})
}
function* foo ({ payload }) {
try {
const data = yield R.map(api, payload) // R = ramda.js
yield R.map(dispatchAllPosts, data)
} catch (err) {
//
}
}
But while i call put in loop app is freezing. Any advices?
Issue Analytics
- State:
- Created 7 years ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
put her in the loop definition | English dictionary for learners
If someone is in the loop, they are part of a group of people who make decisions about important things, or they know...
Read more >Keep (someone) in the loop - Idioms by The Free Dictionary
To keep someone informed about and/or involved in something, such as a plan or project, especially that which involves or pertains to a...
Read more >Be in the loop definition and meaning - Collins Dictionary
If someone is in the loop, they are part of a group of people who make decisions about important things, or they know...
Read more >putting her/him in the loop | WordReference Forums
Sure! Anytime you want to include someone who is currently not involved, it's a common expression to say "include them in the loop"....
Read more >Loop videos or playlists on YouTube - Android - Google Support
When watching YouTube, you can play a video or playlist on repeat by looping it. To repeat a video: Go to the watch...
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
if you want to yield multiple calls in parallel, use the snippet of @sergej-s; to put the results in parallel you can yield an array of put effects
@ArtBIT
yield actions.map(put)
might not work, because put will be called with both action and index arguments.put
s signature isfunction put(channel, action) { ... }
so it would create wrong effect (or just throw when validating.Also you should wrap this with
all
effect which is preferred way of starting parallel effects.So the final code should look like this: