![]() Oh yes! Javascript is not Elixir, so we still need to do defensive programming and protect against errors. Also, it’s possible to do it using a regular for loop and iterate over the array - it’s your call. How the for/of loop works is beyond the scope of this post, but you can find out more here. This pattern is mostly used to trigger a process after an action is dispatched - yeah! Like a listener: /* this is the saga you are going to register */ export function* aListenerOnlySaga() Do you remember the old way when you used to put a listener and watchers everywhere on your angular 1 application? Well, I kind of do…□. Take and Forkīy definition, the most common on my list. But if you happen to know them by some sort of official names, please comment below. Let’s see them one by one with a possible use case for each.ĭisclaimer: I used the names I know for these. Redux saga how to#If you need more information about how to register a saga, or even how to configure, please refer to the first part of the series here.Īfter a year of working with the library and solving problems, we have identified a few patterns that we have repeated over and over. This post assumes that you have a basic understanding of the library. Enough with the emotive introduction - let’s see the patterns. This small donation can make a big difference, and it’s a nice way to make good karma. If you are interested in that, this other post can point you in that direction.Ī side note: If your company happens to rely heavily on this or any open source project, I highly encourage you (and your employer) to become a backer of the project. Redux saga code#So yes, these lines of code help to support the daily operations of several million VC companies - a big part of our application architecture relies on it. It was so good that now I also use it as an orchestration layer to manage all the asynchronous operations at work at Shiftgig. From that day on, due to the curse of knowledge, I couldn’t imagine my life without it. It was so good that I needed to share all this awesomeness with other people - so I sat down and wrote a post about it. I remember how amazed I was (that ‘Eureka’ moment!) when I solved a few problems in matter of hours. I’ve been a redux-saga user for a year now, and I still remember when I was introduced to the library. This is a 2-part series - feel free to check out the first part here. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |