platform icon indicating copy to clipboard operation
platform copied to clipboard

How to we update additional entity properties?

Open sagunpandey opened this issue 7 years ago • 4 comments

Other information:

I would be willing to submit a PR for the docs :heart:

[ ] Yes (Assistance is provided if you need help submitting a pull request) [x] No

I have a reducer where I am updating an entity state by using addAll(). While adding I need to set some other custom entity properties too. I tried checking the docs but couldn't find anything on it. I could have created a second action for just setting those custom properties I guess. But I was wondering if there is a way to set those properties while using adapter methods.

sagunpandey avatar Aug 21 '19 15:08 sagunpandey

@sagunpandey I would say it depends on what updates you need. Setting some attributes to (nearly) fixed values or complex logic?

And who is the source of the action? GUI? An Effect? Other?

manklu avatar Aug 21 '19 17:08 manklu

We have this on a recipe's page: Additional state properties.

Feel free to re-open this issue if it's missing something.

timdeschryver avatar Aug 21 '19 17:08 timdeschryver

on(OrderActions.retActive, (state, { data }) => { return adapter.addAll(data, state) }), is not updating my state i'm using ngrx8, ngrx-entity

NavruzbekNoraliev avatar Aug 30 '19 16:08 NavruzbekNoraliev

image

NavruzbekNoraliev avatar Aug 30 '19 16:08 NavruzbekNoraliev