@cascateer/database 0.0.7 → 0.0.8
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/package.json +1 -1
- package/src/table.ts +14 -16
package/package.json
CHANGED
package/src/table.ts
CHANGED
|
@@ -267,22 +267,20 @@ export const createTable = memoize(
|
|
|
267
267
|
constructor() {
|
|
268
268
|
super(id, key, records, TableInstance.actions);
|
|
269
269
|
|
|
270
|
-
TableInstance.actionsSubscription ??=
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
)
|
|
285
|
-
.subscribe());
|
|
270
|
+
TableInstance.actionsSubscription ??= TableInstance.actions
|
|
271
|
+
.pipe(
|
|
272
|
+
reduceActions(this.applyActions, this.readActions),
|
|
273
|
+
mergeMap(async (action) => {
|
|
274
|
+
const path = resolve(this.path, `${action.id}.json`);
|
|
275
|
+
|
|
276
|
+
if (!existsSync(path)) {
|
|
277
|
+
await writeFile(path, JSON.stringify(action));
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
return action;
|
|
281
|
+
}),
|
|
282
|
+
)
|
|
283
|
+
.subscribe();
|
|
286
284
|
}
|
|
287
285
|
},
|
|
288
286
|
nthArg(0),
|