You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MobX seems to be erasing my native pointers. (To clarify, I am using MobX without React.)
// `state` is a mobx store created with `makeAutoObservable(this)`constinstance=rust.new_instance();// returns a pointerconsole.log(instance);// [External: 600000d44240]state.directHostInstance=instance;// Copy to a MobxStoreconsole.log(state.directHostInstance);// {}console.log(toJS(state).directHostInstance);// {}
How can I get my [External: 600000d44240] back?
The text was updated successfully, but these errors were encountered:
If instance is a plain object, mobx creates an observable copy during an assigment.
If instance should not become observable, you can mark the field as reference makeAutoObservable(this, { directHostInstance: observable.ref })
If it should become observale, you can make it observable manually prior assigment state.directHostInstance = makeAutoObservable(instance), but it's not possible to observe addition/removal of keys of such object. https://mobx.js.org/observable-state.html#avoid-proxies
MobX seems to be erasing my native pointers. (To clarify, I am using MobX without React.)
How can I get my
[External: 600000d44240]
back?The text was updated successfully, but these errors were encountered: