Bug report
Sandbox link or minimal reproduction code
https://codesandbox.io/p/devbox/nameless-shadow-987q7v?workspaceId=ws_V6MwkdyBVdYpA4KMGgF9f5
import { types } from "mobx-state-tree";
const Tweet = types
.model("Tweet", {
body: types.string,
read: false, // automatically inferred as type "boolean" with default "false"
})
.actions((tweet) => ({
toggle() {
tweet.read = !tweet.read;
},
}));
const TwitterStore = types.model("TwitterStore", {
tweets: types.map(Tweet),
});
// create an instance from a snapshot
const twitterStore = TwitterStore.create();
twitterStore.tweets.observe((c) => {}); // 🐞 twitterStore.tweets.observe is not a function
Describe the expected behavior
It will not crash.
Describe the observed behavior
It crashes with twitterStore.tweets.observe is not a function.
Thoughts
I assume the cause is that the ObservableMap no longer have the observe method.
PS: Maybe MSTMap should also implement IMSTMap?
Bug report
Sandbox link or minimal reproduction code
https://codesandbox.io/p/devbox/nameless-shadow-987q7v?workspaceId=ws_V6MwkdyBVdYpA4KMGgF9f5
Describe the expected behavior
It will not crash.
Describe the observed behavior
It crashes with
twitterStore.tweets.observe is not a function.Thoughts
I assume the cause is that the
ObservableMapno longer have theobservemethod.PS: Maybe MSTMap should also implement IMSTMap?