-
Notifications
You must be signed in to change notification settings - Fork 24
Open
Description
Hello.
First of all thank you for the library, it works really great!
I've just bumped into one issue. In our setup we have iframe & parent window running on same domain and interacting with one another.
One of those interactions is:
const intialState = iframe.someFunction();
const state = create(initialState, ...);
Due to this, even though the returned object is "simple", the Object.getPrototypeOf(value) === Object.prototype check fails.
I can overcome this by using mark functionality:
const state = create(initialState, ..., { mark: () => "immutable" });
This brings a couple of questions:
- Is it okay to simply use
mark: () => "immutable",? Will this lead to some side effects? I haven't digged too deep into the source code yet, but couldn't find info in the docs. - Next to
markdocs, it says that (AutoFreeze and Patches should both be disabled). Is that really the case? I've tried to use them withmarkand it looked like it works fine. - Maybe there is a different kind of "simple" object check that would not break in this crazy scenario?
bfelbo
Metadata
Metadata
Assignees
Labels
No labels