7 ms·
>Basically, imagine if a Redux reducer could dispatch further actions. You can achieve the same by using redux-saga[0], then writing a generator function ("sag
by bauerd 8y ago
>Basically, imagine if a Redux reducer could dispatch further actions.
You can achieve the same by using redux-saga[0], then writing a generator function ("saga") that inspects dispatched actions, and potentially triggers a side effect, dispatches another action, waits for another action to get dispatched in a certain time, etc.
[0] https://github.com/redux-saga/redux-saga https://github.com/redux-saga/redux-saga
- EduardoBautista 8y agoI really wish the React ecosystem had less dependencies. Things that are included in other libraries are always met with “You can always install X” as if it were a good thing to add more dependencies.
- wereHamster 8y agoMaybe you want to use react with something other than redux, or saga. Now you say: it doesn't matter, if there is any dead/unused code it will be removed during bundling. That's indeed true. But then, shouldn't we simply install all packages that are available on npmjs.com, and never think about dependencies again? Or don't install any and let our editor or bundler install dependencies automatically? If installing dependencies happens automatically as soon as you write an import statement, does it matter anymore whether you write `import Redux from "redux"` or `import Redux from "react/redux"`? Hardly…
- boubiyeah 8y agoSome people's package.json is the stuff of nightmares
- jnbiche 8y agoI wish NPM were more secure, but I'm glad that the ecosystem uses small libraries. Many people don't need library X for their React/FrameworkX/VueJS project, so including it in the framework just results in additional bloat for them. Extra bytes are not a trivial issue for frontend web development, like they are for many server projects.