DEV Community

Cover image for Object.assign() vs Object Spread { … } In Angular Ngrx Reducers🥊
Tomas Trajan 🇨🇭
Tomas Trajan 🇨🇭

Posted on • Originally published at Medium

4 2

Object.assign() vs Object Spread { … } In Angular Ngrx Reducers🥊

How to get better type checking and code completion support with Typescript in Angular Ngrx reducers or any other Redux-like library

All the code examples in this post are taken from the real world Angular Ngrx Material Starter project in various stages of it’s development

Short recapitulation of Ngrx state library

Ngrx is a state management library which is used to implement one way data flow with centralized state store. Components and services dispatch actions in response to events triggered by user interaction and server communication.

Every dispatched action produces a new application state by triggering corresponding reducer action handler. In the handler we always want to return new object or array to be sure that our new application state is clearly distinct from the old one.

Read more...

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay