import {makeObservable, toJS, observable} from "mobx"
export const observableStruct = <T extends object>(
schema: S.Schema<T>,
) =>
S.transform(
schema,
schema,
// how do I build the arguments to makeObservable based on
// which properties have the observableProp annotation?
v => makeObservable(v, { foo: observable }),
v => toJS(v),
)
import {makeObservable, toJS, observable} from "mobx"
export const observableStruct = <T extends object>(
schema: S.Schema<T>,
) =>
S.transform(
schema,
schema,
// how do I build the arguments to makeObservable based on
// which properties have the observableProp annotation?
v => makeObservable(v, { foo: observable }),
v => toJS(v),
)