Tyler Scott Williams
Tyler Scott Williams
Hey folks, it looks like we had some effort in this regard, but closed a stale PR: https://github.com/mobxjs/mobx-state-tree/pull/857 I'd love to review a new PR against current MST if anyone's...
I think this may be a docs and TypeScript issue. You're calling `preProcessor` and `postProcessor`, but the `types.snapshotProcessor` actually wants `preProcess` and `postProcess`. You can see it working here: https://codesandbox.io/p/sandbox/issue-2136-7hpyd2?file=%2Fsrc%2Findex.ts%3A21%2C3...
Ah, my bad! I had a false positive, was just getting those errors to go away. There *is* a documentation issue. We call it `preProcess` and `postProcess` here: https://mobx-state-tree.js.org/overview/hooks#snapshot-processing-hooks. That's...
Seems to be related to applying the snapshot as an empty array. I can get the processed snapshot, modify it in place, and apply it correctly: ```ts import { types,...
Whoops, getting used to the new CodeSandbox tools. This should work: https://codesandbox.io/p/sandbox/issue-2136-7hpyd2?file=%2Fsrc%2Findex.ts%3A41%2C1
I've got some pass-by-reference errors in there, but I gotta run at the moment so I can revisit this later. Sorry 'bout that!
Interesting. Maybe `types.optional` is having trouble instantiating the default value as a `snapshotProcessor`.
Hey folks - sorry it's been so long without an answer here. I think that the original issue is a misunderstanding of how `safeReference` is intended to work. In the...
Hopefully it's just this: https://github.com/mobxjs/mobx-state-tree/pull/2137 Once we get a test in there I can merge and deploy a patch, probably early this week.
Ah dang. Do you have the full text of the exception with that patched? That might be helpful