/
opt
/
canhelp
/
node_modules
/
nanostores
/
map-creator
/
/opt/canhelp/node_modules/nanostores/map-creator
mkdir
upload
Name
Size
Mode
Actions
index.d.ts
745
0644
edit
dl
rm
index.js
846
0644
edit
dl
rm
Edit:
/opt/canhelp/node_modules/nanostores/map-creator/index.d.ts
(745B)
import type { MapStore } from '../map/index.js' export interface MapCreator< Value extends object = any, Args extends any[] = [] > { (id: string, ...args: Args): MapStore<Value> build(id: string, ...args: Args): MapStore<Value> cache: { [id: string]: MapStore<{ id: string } & Value> } } /** * Create function to create map stores. It will be like a class for store. * * @param init Store’s initializer. Returns store destructor. */ export function mapCreator< Value extends object, Args extends any[] = [], StoreExt = Record<number | string | symbol, any> >( init?: ( store: MapStore<{ id: string } & Value> & StoreExt, id: string, ...args: Args ) => (() => void) | void ): MapCreator<Value, Args>
Save
cmd:
run