lostpebble / pullstate

Simple state stores using immer and React hooks - re-use parts of your state by pulling it anywhere you like!

Home Page:https://lostpebble.github.io/pullstate

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable immer mapSet? How can I use a Map()?

jibees opened this issue · comments

Hello

I'm wondering if there is any opportunity to enableMapSet for pullstate?
I try to update my store state and cannot because of

[Immer] The plugin for 'MapSet' has not been loaded into Immer. To enable the plugin, import and call `enableMapSet()` when initializing your application.

More generally, I just wanted to use a Map() object in my store.

Any idea?

Hi there,

Did you try running enableMapSet() at the top of your code, before the rest of your application / Pullstate mounts? Generally that's the way to add immer features.

I tried, but not at the top of the code (before the rest of your application).
I should have another try thus ;)
Thanks! 🙏