@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/table.ts +14 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascateer/database",
3
- "version": "0.0.7",
3
+ "version": "0.0.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/cascateer/database.git"
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
- (console.log(id, key),
272
- TableInstance.actions
273
- .pipe(
274
- reduceActions(this.applyActions, this.readActions),
275
- mergeMap(async (action) => {
276
- const path = resolve(this.path, `${action.id}.json`);
277
-
278
- if (!existsSync(path)) {
279
- await writeFile(path, JSON.stringify(action));
280
- }
281
-
282
- return action;
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),