mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-12-14 04:52:57 +00:00
16 lines
285 B
TypeScript
16 lines
285 B
TypeScript
export default class Store {
|
|
private data: any;
|
|
|
|
constructor({ initialData = {} }: { initialData?: any } = {}) {
|
|
this.data = initialData;
|
|
}
|
|
|
|
public set(key: string, value: any) {
|
|
this.data[key] = value;
|
|
}
|
|
|
|
public get(key: string) {
|
|
return this.data[key];
|
|
}
|
|
}
|