react-rock 3.2.15 → 3.2.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Store.cjs +280 -265
- package/Store.cjs.map +1 -1
- package/Store.d.ts +25 -25
- package/Store.js +280 -265
- package/Store.js.map +1 -1
- package/index.cjs +2 -2
- package/index.cjs.map +1 -1
- package/index.js +2 -2
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/readme.md +230 -230
- package/types.d.ts +60 -60
package/Store.d.ts
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
1
|
import { RowSchema, MetaSchema, MakeRowType, CreateManyArgs, CreateArgs, UpdateArgs, DeleteArgs, FindArgs, MoveArgs } from './types.js';
|
|
2
2
|
import { Infer } from 'xanv';
|
|
3
3
|
|
|
4
|
-
declare class Store<RS extends RowSchema, MS extends MetaSchema | undefined = undefined> {
|
|
5
|
-
private _rows;
|
|
6
|
-
private _meta;
|
|
7
|
-
private _hooks;
|
|
8
|
-
private
|
|
9
|
-
private
|
|
10
|
-
private
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
getIndex(args: FindArgs<RS>): number;
|
|
24
|
-
move(args: MoveArgs<RS>): boolean;
|
|
25
|
-
setMeta<T extends keyof Infer<MS>>(key: T, value: Infer<MS>[T], disableObservation?: boolean): void;
|
|
26
|
-
getMeta<T extends keyof Infer<MS>>(key: T, disableObservation?: boolean): Infer<MS>[T] | undefined;
|
|
27
|
-
deleteMeta<T extends keyof Infer<MS>>(key: T, disableObservation?: boolean): void;
|
|
28
|
-
clearMeta(disableObservation?: boolean): void;
|
|
4
|
+
declare class Store<RS extends RowSchema, MS extends MetaSchema | undefined = undefined> {
|
|
5
|
+
private _rows;
|
|
6
|
+
private _meta;
|
|
7
|
+
private _hooks;
|
|
8
|
+
private _row_schema;
|
|
9
|
+
private _meta_schema?;
|
|
10
|
+
private _last_id;
|
|
11
|
+
constructor(rowSchema: RS, metaSchema?: MS);
|
|
12
|
+
observe: (observeId?: string) => void;
|
|
13
|
+
dispatch(observeIdOrCallbabck?: string | ((cb: Function, key: string) => void)): void;
|
|
14
|
+
rows(disableObservation?: boolean): Map<number, MakeRowType<RS>>;
|
|
15
|
+
metas(disableObservation?: boolean): Map<keyof Infer<MS>, Infer<MS>[keyof Infer<MS>]>;
|
|
16
|
+
createMany(args: CreateManyArgs<RS>): MakeRowType<RS>[];
|
|
17
|
+
create(args: CreateArgs<RS>): MakeRowType<RS>;
|
|
18
|
+
update(args: UpdateArgs<RS>): MakeRowType<RS>[] | null;
|
|
19
|
+
delete(args: DeleteArgs<RS>): number;
|
|
20
|
+
find(args: FindArgs<RS>): MakeRowType<RS>[];
|
|
21
|
+
findOne(args: FindArgs<RS>): MakeRowType<RS> | null;
|
|
22
|
+
findById(rid: number, disableObservation?: boolean): MakeRowType<RS> | undefined;
|
|
23
|
+
getIndex(args: FindArgs<RS>): number;
|
|
24
|
+
move(args: MoveArgs<RS>): boolean;
|
|
25
|
+
setMeta<T extends keyof Infer<MS>>(key: T, value: Infer<MS>[T], disableObservation?: boolean): void;
|
|
26
|
+
getMeta<T extends keyof Infer<MS>>(key: T, disableObservation?: boolean): Infer<MS>[T] | undefined;
|
|
27
|
+
deleteMeta<T extends keyof Infer<MS>>(key: T, disableObservation?: boolean): void;
|
|
28
|
+
clearMeta(disableObservation?: boolean): void;
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export { Store as default };
|
package/Store.js
CHANGED
|
@@ -2,271 +2,286 @@
|
|
|
2
2
|
import { useId, useState, useEffect } from 'react';
|
|
3
3
|
import { xv } from 'xanv';
|
|
4
4
|
|
|
5
|
-
const uid = useId;
|
|
6
|
-
const ustate = useState;
|
|
7
|
-
const ueffect = useEffect;
|
|
8
|
-
class Store {
|
|
9
|
-
constructor(rowSchema, metaSchema) {
|
|
10
|
-
|
|
11
|
-
this.
|
|
12
|
-
this.
|
|
13
|
-
this.
|
|
14
|
-
this._last_id = 0;
|
|
15
|
-
this.observe = (observeId) => {
|
|
16
|
-
try {
|
|
17
|
-
const hid = uid();
|
|
18
|
-
const id = observeId !== null && observeId !== void 0 ? observeId : hid;
|
|
19
|
-
const [, dispatch] = ustate(0);
|
|
20
|
-
ueffect(() => {
|
|
21
|
-
this._hooks.set(id, () => dispatch(Math.random()));
|
|
22
|
-
return () => {
|
|
23
|
-
this._hooks.delete(id);
|
|
24
|
-
};
|
|
25
|
-
}, []);
|
|
26
|
-
}
|
|
27
|
-
catch (error) { }
|
|
28
|
-
};
|
|
29
|
-
this._row_schema = Object.assign(Object.assign({}, rowSchema), { rid: xv.number(), vid: xv
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
let
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
this._last_id
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
let
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
const
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
match = false;
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
if (condition.endWith !== undefined) {
|
|
173
|
-
if (typeof rvalue !== "string" ||
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
5
|
+
const uid = useId;
|
|
6
|
+
const ustate = useState;
|
|
7
|
+
const ueffect = useEffect;
|
|
8
|
+
class Store {
|
|
9
|
+
constructor(rowSchema, metaSchema) {
|
|
10
|
+
// private _rows: MakeRowType<RS>[] = [];
|
|
11
|
+
this._rows = new Map();
|
|
12
|
+
this._meta = new Map();
|
|
13
|
+
this._hooks = new Map();
|
|
14
|
+
this._last_id = 0;
|
|
15
|
+
this.observe = (observeId) => {
|
|
16
|
+
try {
|
|
17
|
+
const hid = uid();
|
|
18
|
+
const id = observeId !== null && observeId !== void 0 ? observeId : hid;
|
|
19
|
+
const [, dispatch] = ustate(0);
|
|
20
|
+
ueffect(() => {
|
|
21
|
+
this._hooks.set(id, () => dispatch(Math.random()));
|
|
22
|
+
return () => {
|
|
23
|
+
this._hooks.delete(id);
|
|
24
|
+
};
|
|
25
|
+
}, []);
|
|
26
|
+
}
|
|
27
|
+
catch (error) { }
|
|
28
|
+
};
|
|
29
|
+
this._row_schema = Object.assign(Object.assign({}, rowSchema), { rid: xv.number(), vid: xv
|
|
30
|
+
.number()
|
|
31
|
+
.default(() => Math.round((Math.random() + Math.random()) * 9999999999)) });
|
|
32
|
+
this._meta_schema = metaSchema;
|
|
33
|
+
}
|
|
34
|
+
dispatch(observeIdOrCallbabck) {
|
|
35
|
+
if (typeof observeIdOrCallbabck === "string") {
|
|
36
|
+
const cb = this._hooks.get(observeIdOrCallbabck);
|
|
37
|
+
if (cb) {
|
|
38
|
+
cb();
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this._hooks.forEach((cb, key) => {
|
|
43
|
+
try {
|
|
44
|
+
if (typeof observeIdOrCallbabck === "function") {
|
|
45
|
+
observeIdOrCallbabck(cb, key);
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
cb();
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
catch (_err) {
|
|
52
|
+
this._hooks.delete(key);
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
rows(disableObservation = false) {
|
|
58
|
+
if (!disableObservation) {
|
|
59
|
+
this.observe();
|
|
60
|
+
}
|
|
61
|
+
return this._rows;
|
|
62
|
+
}
|
|
63
|
+
metas(disableObservation = false) {
|
|
64
|
+
if (!disableObservation) {
|
|
65
|
+
this.observe();
|
|
66
|
+
}
|
|
67
|
+
return this._meta;
|
|
68
|
+
}
|
|
69
|
+
createMany(args) {
|
|
70
|
+
const { data, disableObservation, observeId } = args;
|
|
71
|
+
const res = [];
|
|
72
|
+
for (let row of data) {
|
|
73
|
+
const created = this.create({
|
|
74
|
+
data: row,
|
|
75
|
+
disableObservation: true,
|
|
76
|
+
});
|
|
77
|
+
res.push(created);
|
|
78
|
+
}
|
|
79
|
+
if (!disableObservation) {
|
|
80
|
+
this.dispatch(observeId);
|
|
81
|
+
}
|
|
82
|
+
return res;
|
|
83
|
+
}
|
|
84
|
+
// Row Methods
|
|
85
|
+
create(args) {
|
|
86
|
+
const { data, disableObservation, observeId } = args;
|
|
87
|
+
// validate and create row
|
|
88
|
+
let r = {};
|
|
89
|
+
for (let key in this._row_schema) {
|
|
90
|
+
if (key === "rid" || key === "vid")
|
|
91
|
+
continue;
|
|
92
|
+
const schema = this._row_schema[key];
|
|
93
|
+
r[key] = schema.parse(data[key]);
|
|
94
|
+
}
|
|
95
|
+
this._last_id = this._last_id + 1;
|
|
96
|
+
const _row = Object.assign(Object.assign({}, r), { rid: this._last_id, vid: this._row_schema.vid.parse(undefined) });
|
|
97
|
+
this._rows.set(_row.rid, _row);
|
|
98
|
+
if (!disableObservation) {
|
|
99
|
+
this.dispatch(observeId);
|
|
100
|
+
}
|
|
101
|
+
return _row;
|
|
102
|
+
}
|
|
103
|
+
// update
|
|
104
|
+
update(args) {
|
|
105
|
+
const { data, where, disableObservation, observeId } = args;
|
|
106
|
+
// validate row
|
|
107
|
+
let r = {};
|
|
108
|
+
for (let key in data) {
|
|
109
|
+
if (key === "rid" || key === "vid")
|
|
110
|
+
continue;
|
|
111
|
+
const schema = this._row_schema[key];
|
|
112
|
+
r[key] = schema.parse(data[key]);
|
|
113
|
+
}
|
|
114
|
+
const rows = this.find({ disableObservation: true, where });
|
|
115
|
+
if (rows.length > 0) {
|
|
116
|
+
for (let index = 0; index < rows.length; index++) {
|
|
117
|
+
const _row = rows[index];
|
|
118
|
+
const rid = _row.rid;
|
|
119
|
+
this._rows.set(rid, Object.assign(Object.assign(Object.assign({}, _row), r), { rid, vid: this._row_schema.vid.parse(undefined) }));
|
|
120
|
+
}
|
|
121
|
+
if (!disableObservation) {
|
|
122
|
+
this.dispatch(observeId);
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
return this.find({ where, disableObservation: true });
|
|
126
|
+
}
|
|
127
|
+
// delete
|
|
128
|
+
delete(args) {
|
|
129
|
+
const { where, disableObservation, observeId } = args;
|
|
130
|
+
const rows = this.find({
|
|
131
|
+
where,
|
|
132
|
+
disableObservation: true,
|
|
133
|
+
});
|
|
134
|
+
let deletedCount = rows.length;
|
|
135
|
+
if (rows.length > 0) {
|
|
136
|
+
for (let row of rows) {
|
|
137
|
+
this._rows.delete(row.rid);
|
|
138
|
+
}
|
|
139
|
+
if (!disableObservation) {
|
|
140
|
+
this.dispatch(observeId);
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
return deletedCount;
|
|
144
|
+
}
|
|
145
|
+
// find
|
|
146
|
+
find(args) {
|
|
147
|
+
const { where, disableObservation, observeId } = args;
|
|
148
|
+
if (!disableObservation) {
|
|
149
|
+
this.observe(observeId);
|
|
150
|
+
}
|
|
151
|
+
const rows = [];
|
|
152
|
+
for (const row of Array.from(this._rows.values())) {
|
|
153
|
+
let match = true;
|
|
154
|
+
for (const wcol in where) {
|
|
155
|
+
const condition = where[wcol];
|
|
156
|
+
const rvalue = row[wcol];
|
|
157
|
+
if (typeof condition === "object" && condition !== null) {
|
|
158
|
+
if (condition.contain !== undefined) {
|
|
159
|
+
if (typeof rvalue !== "string" ||
|
|
160
|
+
!rvalue.includes(condition.contain)) {
|
|
161
|
+
match = false;
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (condition.startWith !== undefined) {
|
|
166
|
+
if (typeof rvalue !== "string" ||
|
|
167
|
+
!rvalue.startsWith(condition.startWith)) {
|
|
168
|
+
match = false;
|
|
169
|
+
break;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (condition.endWith !== undefined) {
|
|
173
|
+
if (typeof rvalue !== "string" ||
|
|
174
|
+
!rvalue.endsWith(condition.endWith)) {
|
|
175
|
+
match = false;
|
|
176
|
+
break;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
if (condition.equalWith !== undefined &&
|
|
180
|
+
rvalue !== condition.equalWith) {
|
|
181
|
+
match = false;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
if (condition.notEqualWith !== undefined &&
|
|
185
|
+
rvalue === condition.notEqualWith) {
|
|
186
|
+
match = false;
|
|
187
|
+
break;
|
|
188
|
+
}
|
|
189
|
+
if (condition.gt !== undefined) {
|
|
190
|
+
if (typeof rvalue !== "number" || !(rvalue > condition.gt)) {
|
|
191
|
+
match = false;
|
|
192
|
+
break;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
if (condition.lt !== undefined) {
|
|
196
|
+
if (typeof rvalue !== "number" || !(rvalue < condition.lt)) {
|
|
197
|
+
match = false;
|
|
198
|
+
break;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
if (condition.gte !== undefined) {
|
|
202
|
+
if (typeof rvalue !== "number" || !(rvalue >= condition.gte)) {
|
|
203
|
+
match = false;
|
|
204
|
+
break;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (condition.lte !== undefined) {
|
|
208
|
+
if (typeof rvalue !== "number" || !(rvalue <= condition.lte)) {
|
|
209
|
+
match = false;
|
|
210
|
+
break;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
if (condition !== rvalue) {
|
|
216
|
+
match = false;
|
|
217
|
+
break;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
if (match) {
|
|
222
|
+
rows.push(row);
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
return rows;
|
|
226
|
+
}
|
|
227
|
+
findOne(args) {
|
|
228
|
+
const rows = this.find(args);
|
|
229
|
+
return rows.length > 0 ? rows[0] : null;
|
|
230
|
+
}
|
|
231
|
+
findById(rid, disableObservation = false) {
|
|
232
|
+
if (!disableObservation) {
|
|
233
|
+
this.observe(rid.toString());
|
|
234
|
+
}
|
|
235
|
+
return this._rows.get(rid);
|
|
236
|
+
}
|
|
237
|
+
getIndex(args) {
|
|
238
|
+
const row = this.findOne(args);
|
|
239
|
+
if (row) {
|
|
240
|
+
const keys = Array.from(this._rows.keys());
|
|
241
|
+
return keys.indexOf(row.rid);
|
|
242
|
+
}
|
|
243
|
+
return -1;
|
|
244
|
+
}
|
|
245
|
+
move(args) {
|
|
246
|
+
const { fromIndex, toIndex, disableObservation, observeId } = args;
|
|
247
|
+
if (fromIndex < 0 || toIndex < 0)
|
|
248
|
+
return false;
|
|
249
|
+
const entries = [...Array.from(this._rows.entries())];
|
|
250
|
+
if (fromIndex >= entries.length || toIndex >= entries.length) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
const [movedItem] = entries.splice(fromIndex, 1);
|
|
254
|
+
entries.splice(toIndex, 0, movedItem);
|
|
255
|
+
this._rows = new Map(entries);
|
|
256
|
+
if (!disableObservation) {
|
|
257
|
+
this.dispatch(observeId);
|
|
258
|
+
}
|
|
259
|
+
return true;
|
|
260
|
+
}
|
|
261
|
+
setMeta(key, value, disableObservation = false) {
|
|
262
|
+
this._meta.set(key, this._meta_schema ? this._meta_schema[key].parse(value) : value);
|
|
263
|
+
if (!disableObservation) {
|
|
264
|
+
this.dispatch();
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
getMeta(key, disableObservation = false) {
|
|
268
|
+
if (!disableObservation) {
|
|
269
|
+
this.observe();
|
|
270
|
+
}
|
|
271
|
+
return this._meta.get(key);
|
|
272
|
+
}
|
|
273
|
+
deleteMeta(key, disableObservation = false) {
|
|
274
|
+
this._meta.delete(key);
|
|
275
|
+
if (!disableObservation) {
|
|
276
|
+
this.dispatch();
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
clearMeta(disableObservation = false) {
|
|
280
|
+
this._meta.clear();
|
|
281
|
+
if (!disableObservation) {
|
|
282
|
+
this.dispatch();
|
|
283
|
+
}
|
|
284
|
+
}
|
|
270
285
|
}
|
|
271
286
|
|
|
272
287
|
export { Store as default };
|