ngxs-labs / immer-adapter

:hamster: Declarative state mutations
MIT License
46 stars 10 forks source link

@ImmutableContext() doesn't work with Receiver() properly #225

Closed luthor77 closed 5 years ago

luthor77 commented 5 years ago

Before the change from produce operator to ImmutableContext decorator, the Receiver decorator from Emitter plugin had the implementation with immer-adapter documented here, now it doesn't.

It works with the new decorator, but it gives this error, preventing from compiling in aot: erro-immer-emmiter

The immer-adapter won't give support anymore to Emmiter plugin?

splincode commented 5 years ago

Please add stackblitz example for reproduce

splincode commented 5 years ago

Because immer-adapter integrated with emitter

https://github.com/ngxs-labs/immer-adapter/blob/master/src/tests/helpers/todo.helper.ts

luthor77 commented 5 years ago

You can see the error in the Receiver setStatus.

https://stackblitz.com/edit/angular-nq4xe9

luthor77 commented 5 years ago

Thanks for the link, i didn't see this, I think https://ngxs.gitbook.io/ngxs/ could be updated.

splincode commented 5 years ago

image

luthor77 commented 5 years ago

stackblitz-error

luthor77 commented 5 years ago

Oh, So I just need to pass the Model?! Ok, only one more question, using the ImmutableSelector should be able to modify the returned object?

splincode commented 5 years ago

using the ImmutableSelector should be able to modify the returned object?

yes

luthor77 commented 5 years ago

Ok, sometimes I can't, I will investigate better, if I can't resolve I'll open an issue. Thanks for the help.