Unlike thunks that are carried out when you dispatch them, sagas run in the background right. Instead of dispatching functions processed by Redux Thunk you create saga and write all the logic of event stream processing. Redux Saga is an alternative approach to the organization of side effects. ![]() Thanks to this approach, we can decouple side effects entirely into sagas that act as if they. arranges that dispatch() can return a promise: it, you define a "promise action" creator via: import from './actions'įunction * fetchPostSaga(action: typeof fetchPostAction.types. In this situation, Redux Saga comes to the rescue. Redux Saga Redux Saga rely heavily on the generator pattern. There's a package that does exactly what the OP requested, i.e.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |