FAQ

What are the benefits of NgRx Ducks?

  • โš™๏ธ 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

What is a Duck?

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

Which version of ngrx is supported?

The version number of @ngrx-ducks is aligned with ngrx/platform. The major versions of both projects are compatible with each other.

What happens to the previous Decorator-API?

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.

Why does the Decorator-API needs a successor?

Short answers:

  • 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.

What about Angular 8?

The new API isnโ€™t only ready for Angular 9. ๐ŸŽ‰ Since NgRx-Ducks 8.4 you can already benefit from createDuck and its friends.

Please note that NgRx Ducks 8 is hosted under the co-IT scope. You need to run npm install @co-it/ngrx-ducks@8.4 to get the Angular 8 compatible version.

Last updated