Brian Hung

Results 91 comments of Brian Hung

> I'm curious what the community thinks. I think this could be a positive addition to the MST API. As a newcomer to MST, I'm in support of adding `types.object`;...

To add to previous point, one ability that plain objects have over maps is the ability to easily deeply destructure: https://stackoverflow.com/questions/49569682/destructuring-a-map

> Why do you want a map of references and not an array? Array doesn't enforce uniqueness; for example an unordered map of children nodes.

> Again, as I'm not at all familiar with the internals of Automerge, I don't know if this is feasible. I would look at zustand and valtio which have similar...

Reversing then applying seemed to fix for me: ``` "postinstall": "cd ../.. && npx patch-package --reverse && npx patch-package --error-on-fail" ```

> While patchedState is indeed deep equal to producedState, there is a difference in that produce preserves object identity, but applyPatches does not. The reason for this lies within this...

@moklick Can `nokey` be documented in https://reactflow.dev/docs/? Thanks

The primary cause of the issue is that `mobx` `array.replace` is a shallow function over `splice` ```tsx replace(newItems: any[]) { const adm: ObservableArrayAdministration = this[$mobx] return adm.spliceWithArray_(0, adm.values_.length, newItems) },...

There is a separate issue from re-applying patches to an array that were just generated from onPatch. Expectation is that if values are deeply equal, no patches should be emitted....

Looking further into this issue, array `clear` and `replace` can be optimized to emit a single patch. However, map `merge` and `replace` cannot because [mobx itself doesn't emit granular enough...