mobx-keystone-mindreframer
Version:
A MobX powered state management solution based on data trees with first class support for Typescript, snapshots, patches and much more
14 lines (13 loc) • 573 B
TypeScript
/**
* Creates a tag data accessor for a target object of a certain type.
* Tag data will be lazy created on access and reused for the same target object.
*
* @typeparam Target Target type.
* @typeparam TagData Tag data type.
* @param tagDataConstructor Function that will be called the first time the tag
* for a given object is requested.
* @returns The tag data associated with the target object.
*/
export declare function tag<Target extends object, TagData>(tagDataConstructor: (target: Target) => TagData): {
for(target: Target): TagData;
};