@coaction/yjs 1.1.0 → 1.3.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.js CHANGED
@@ -47,6 +47,13 @@ __export(src_exports, {
47
47
  var Y = __toESM(require("yjs"));
48
48
  __reExport(src_exports, require("yjs"));
49
49
  var STATE_KEY = "state";
50
+ var scheduleMicrotask = (callback) => {
51
+ if (typeof queueMicrotask === "function") {
52
+ queueMicrotask(callback);
53
+ return;
54
+ }
55
+ Promise.resolve().then(callback);
56
+ };
50
57
  function clone(value) {
51
58
  if (typeof structuredClone === "function") {
52
59
  return structuredClone(value);
@@ -409,7 +416,7 @@ var bindYjs = (store, options = {}) => {
409
416
  return;
410
417
  }
411
418
  flushScheduled = true;
412
- queueMicrotask(flushFromYjs);
419
+ scheduleMicrotask(flushFromYjs);
413
420
  };
414
421
  const flushFromYjs = () => {
415
422
  flushScheduled = false;
package/dist/index.mjs CHANGED
@@ -35,6 +35,13 @@ __reExport(src_exports, yjs_star);
35
35
  import * as Y from "yjs";
36
36
  import * as yjs_star from "yjs";
37
37
  var STATE_KEY = "state";
38
+ var scheduleMicrotask = (callback) => {
39
+ if (typeof queueMicrotask === "function") {
40
+ queueMicrotask(callback);
41
+ return;
42
+ }
43
+ Promise.resolve().then(callback);
44
+ };
38
45
  function clone(value) {
39
46
  if (typeof structuredClone === "function") {
40
47
  return structuredClone(value);
@@ -397,7 +404,7 @@ var bindYjs = (store, options = {}) => {
397
404
  return;
398
405
  }
399
406
  flushScheduled = true;
400
- queueMicrotask(flushFromYjs);
407
+ scheduleMicrotask(flushFromYjs);
401
408
  };
402
409
  const flushFromYjs = () => {
403
410
  flushScheduled = false;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coaction/yjs",
3
- "version": "1.1.0",
3
+ "version": "1.3.0",
4
4
  "description": "A Coaction integration tool for Yjs",
5
5
  "keywords": [
6
6
  "state",
@@ -38,7 +38,7 @@
38
38
  "url": "https://github.com/unadlib/coaction/issues"
39
39
  },
40
40
  "peerDependencies": {
41
- "coaction": "^1.1.0",
41
+ "coaction": "^1.3.0",
42
42
  "yjs": "^13.6.0"
43
43
  },
44
44
  "peerDependenciesMeta": {
@@ -50,8 +50,8 @@
50
50
  }
51
51
  },
52
52
  "devDependencies": {
53
- "coaction": "^1.1.0",
54
- "yjs": "^13.6.27"
53
+ "yjs": "^13.6.27",
54
+ "coaction": "1.3.0"
55
55
  },
56
56
  "publishConfig": {
57
57
  "access": "public",