forked from abner/for-legacy-web
feat(mobx): add drafts and state context
This commit is contained in:
16
src/mobx/Persistent.ts
Normal file
16
src/mobx/Persistent.ts
Normal file
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* A data store which is persistent and should cache its data locally.
|
||||
*/
|
||||
export default interface Persistent<T> {
|
||||
/**
|
||||
* Override toJSON to serialise this data store.
|
||||
* This will also force all subclasses to implement this method.
|
||||
*/
|
||||
toJSON(): unknown;
|
||||
|
||||
/**
|
||||
* Hydrate this data store using given data.
|
||||
* @param data Given data
|
||||
*/
|
||||
hydrate(data: T): void;
|
||||
}
|
||||
Reference in New Issue
Block a user