⚙️ Create both Reducer and Action Automatically
🤫 Get rid of verbose action declarations
️️️⤵️ Reduce imports of Action Types and Action Creators
💉 Use typed Services instead of dispatching Actions
🙅 No code generation that needs to be maintained manually
A Duck bundles the tasks of
As user, you only need to declare which method needs to be executed when a certain action is dispatched. Multiple Ducks are used to generate the Reducer automatically. You end up writing a class containing pure functions. Leave the rest to
@ngrx-ducks/core. Components are fully independent of Redux-Architecture
The version number of @ngrx-ducks is aligned with ngrx/platform. The major versions of both projects are compatible with each other.
Short answer: Nothing
👍 The Decorator API is still there and can be used. If you already use NgRx Ducks you do not have to worry about breaking changes in your app.
Better compatibility with NgRx’s types
Reduction of boilerplate
Make component fully independent of Redux-Architecture
Even better type-support
There are various reasons that motivated to improve the API of NgRx Ducks. A video discusses the differences in more detail. You are welcome to join the discussion.
The new API isn’t only ready for Angular 9. 🎉 Since NgRx-Ducks 8.4 you can already benefit from
createDuck and its friends.