quarrant / mobx-persist-store

Persist and rehydrate observable properties in mobx store.
268 stars 14 forks source link

Use of inheritance in Store classes #111

Open zhanazhan opened 10 months ago

zhanazhan commented 10 months ago

I have a parent store:

export abstract class PromiseStore<T> {
    protected _data: T;
}

and Child Store:

export class InitialDataStore extends PromiseStore<InitialData> {
    constructor() {
        makeObservable(this, {
            _data: observable,
        });
        makePersistable(this, {
            name: 'InitialDataStore',
            properties: [
                '_data'
            ]
        });
    }
}

Now I cannot build app as it complains that '_data' is not keyof this.

Any ideas to overcome this issue?

quarrant commented 8 months ago

We couldn't support inheritance. Honestly we didn't think about this case