The communications platform that puts data protection first.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
Rocket.Chat/apps/meteor/client/lib/cachedStores/createGlobalStore.ts

14 lines
398 B

import type { StoreApi, UseBoundStore } from 'zustand';
import type { IDocumentMapStore } from './DocumentMapStore';
export const createGlobalStore = <T extends { _id: string }, U>(store: UseBoundStore<StoreApi<IDocumentMapStore<T>>>, extension?: U) =>
Object.assign(
{
use: store,
get state(): IDocumentMapStore<T> {
return this.use.getState();
},
} as const,
extension,
);