@knotx/plugins-batch 0.4.16 → 0.5.0

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/dist/index.cjs CHANGED
@@ -3,6 +3,7 @@
3
3
  const core = require('@knotx/core');
4
4
  const decorators = require('@knotx/decorators');
5
5
  const rxjs = require('rxjs');
6
+ const operators = require('rxjs/operators');
6
7
 
7
8
  var __create = Object.create;
8
9
  var __defProp = Object.defineProperty;
@@ -66,17 +67,17 @@ class Batch extends (_a = core.BasePlugin, _addNodePipe_dec = [decorators.inject
66
67
  init() {
67
68
  this.addNodePipe({
68
69
  transform: (operations$) => rxjs.pipe(
69
- rxjs.exhaustMap((firstOperation) => {
70
+ operators.exhaustMap((firstOperation) => {
70
71
  if ("draftId" in firstOperation) {
71
72
  return rxjs.of([firstOperation]);
72
73
  }
73
74
  return operations$.pipe(
74
- rxjs.startWith(firstOperation),
75
- rxjs.buffer(rxjs.timer(100)),
76
- rxjs.take(1)
75
+ operators.startWith(firstOperation),
76
+ operators.buffer(rxjs.timer(100)),
77
+ operators.take(1)
77
78
  );
78
79
  }),
79
- rxjs.map((operations) => ({
80
+ operators.map((operations) => ({
80
81
  type: "batch",
81
82
  operations: operations.flatMap((op) => op.type === "batch" ? op.operations : op)
82
83
  }))
package/dist/index.js CHANGED
@@ -1,6 +1,7 @@
1
1
  import { BasePlugin } from '@knotx/core';
2
2
  import { inject, OnInit } from '@knotx/decorators';
3
- import { pipe, exhaustMap, of, startWith, buffer, timer, take, map } from 'rxjs';
3
+ import { pipe, of, timer } from 'rxjs';
4
+ import { exhaustMap, startWith, buffer, take, map } from 'rxjs/operators';
4
5
 
5
6
  var __create = Object.create;
6
7
  var __defProp = Object.defineProperty;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knotx/plugins-batch",
3
- "version": "0.4.16",
3
+ "version": "0.5.0",
4
4
  "description": "Batch Plugin for Knotx",
5
5
  "author": "boenfu",
6
6
  "license": "MIT",
@@ -28,18 +28,18 @@
28
28
  "dist"
29
29
  ],
30
30
  "peerDependencies": {
31
- "@knotx/jsx": "0.4.16"
31
+ "@knotx/jsx": "0.5.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "rxjs": "^7.8.1",
35
- "@knotx/core": "0.4.16",
36
- "@knotx/decorators": "0.4.16"
35
+ "@knotx/core": "0.5.0",
36
+ "@knotx/decorators": "0.5.0"
37
37
  },
38
38
  "devDependencies": {
39
- "@knotx/build-config": "0.4.16",
40
- "@knotx/eslint-config": "0.4.16",
41
- "@knotx/jsx": "0.4.16",
42
- "@knotx/typescript-config": "0.4.16"
39
+ "@knotx/build-config": "0.5.0",
40
+ "@knotx/eslint-config": "0.5.0",
41
+ "@knotx/jsx": "0.5.0",
42
+ "@knotx/typescript-config": "0.5.0"
43
43
  },
44
44
  "scripts": {
45
45
  "build": "unbuild",