@signaldb/mobx 1.0.0 → 2.0.0-beta.2

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.mjs CHANGED
@@ -1,14 +1,14 @@
1
- import { observable as t, runInAction as n, onBecomeUnobserved as r } from "mobx";
1
+ import { onBecomeUnobserved as t, observable as n, runInAction as r } from "mobx";
2
2
  import { createReactivityAdapter as c } from "@signaldb/core";
3
3
  const p = c({
4
4
  create: () => {
5
- const e = t({ count: 0 });
5
+ const e = n({ count: 0 });
6
6
  return {
7
7
  depend: () => {
8
8
  e.count;
9
9
  },
10
10
  notify: () => {
11
- n(() => {
11
+ r(() => {
12
12
  e.count += 1;
13
13
  });
14
14
  },
@@ -17,7 +17,7 @@ const p = c({
17
17
  },
18
18
  isInScope: void 0,
19
19
  onDispose(e, { raw: o }) {
20
- r(o, "count", e);
20
+ t(o, "count", e);
21
21
  }
22
22
  });
23
23
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { observable, runInAction, onBecomeUnobserved, } from 'mobx';\nimport { createReactivityAdapter } from '@signaldb/core';\nconst mobxReactivityAdapter = createReactivityAdapter({\n create: () => {\n const dep = observable({ count: 0 });\n return {\n depend: () => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n dep.count;\n },\n notify: () => {\n runInAction(() => {\n dep.count += 1;\n });\n },\n raw: dep,\n };\n },\n isInScope: undefined,\n onDispose(callback, { raw: dep }) {\n onBecomeUnobserved(dep, 'count', callback);\n },\n});\nexport default mobxReactivityAdapter;\n"],"names":["mobxReactivityAdapter","createReactivityAdapter","dep","observable","runInAction","callback","onBecomeUnobserved"],"mappings":";;AAEA,MAAMA,IAAwBC,EAAwB;AAAA,EAClD,QAAQ,MAAM;AACV,UAAMC,IAAMC,EAAW,EAAE,OAAO,GAAG;AAC5B,WAAA;AAAA,MACH,QAAQ,MAAM;AAEN,QAAAD,EAAA;AAAA,MACR;AAAA,MACA,QAAQ,MAAM;AACV,QAAAE,EAAY,MAAM;AACd,UAAAF,EAAI,SAAS;AAAA,QAAA,CAChB;AAAA,MACL;AAAA,MACA,KAAKA;AAAA,IACT;AAAA,EACJ;AAAA,EACA,WAAW;AAAA,EACX,UAAUG,GAAU,EAAE,KAAKH,KAAO;AACX,IAAAI,EAAAJ,GAAK,SAASG,CAAQ;AAAA,EAAA;AAEjD,CAAC;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/index.ts"],"sourcesContent":["import { observable, runInAction, onBecomeUnobserved, } from 'mobx';\nimport { createReactivityAdapter } from '@signaldb/core';\nconst mobxReactivityAdapter = createReactivityAdapter({\n create: () => {\n const dep = observable({ count: 0 });\n return {\n depend: () => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n dep.count;\n },\n notify: () => {\n runInAction(() => {\n dep.count += 1;\n });\n },\n raw: dep,\n };\n },\n isInScope: undefined,\n onDispose(callback, { raw: dep }) {\n onBecomeUnobserved(dep, 'count', callback);\n },\n});\nexport default mobxReactivityAdapter;\n"],"names":["mobxReactivityAdapter","createReactivityAdapter","dep","observable","runInAction","callback","onBecomeUnobserved"],"mappings":";;AAEA,MAAMA,IAAwBC,EAAwB;AAAA,EAClD,QAAQ,MAAM;AACV,UAAMC,IAAMC,EAAW,EAAE,OAAO,GAAG;AACnC,WAAO;AAAA,MACH,QAAQ,MAAM;AAEV,QAAAD,EAAI;AAAA,MACR;AAAA,MACA,QAAQ,MAAM;AACV,QAAAE,EAAY,MAAM;AACd,UAAAF,EAAI,SAAS;AAAA,QACjB,CAAC;AAAA,MACL;AAAA,MACA,KAAKA;AAAA,IAAA;AAAA,EAEb;AAAA,EACA,WAAW;AAAA,EACX,UAAUG,GAAU,EAAE,KAAKH,KAAO;AAC9B,IAAAI,EAAmBJ,GAAK,SAASG,CAAQ;AAAA,EAC7C;AACJ,CAAC;"}
package/dist/index.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("mobx"),require("@signaldb/core")):typeof define=="function"&&define.amd?define(["mobx","@signaldb/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.SignalDB=n(e.mobx,e.core))})(this,function(e,n){"use strict";return n.createReactivityAdapter({create:()=>{const t=e.observable({count:0});return{depend:()=>{t.count},notify:()=>{e.runInAction(()=>{t.count+=1})},raw:t}},isInScope:void 0,onDispose(t,{raw:o}){e.onBecomeUnobserved(o,"count",t)}})});
1
+ (function(e,n){typeof exports=="object"&&typeof module<"u"?module.exports=n(require("mobx"),require("@signaldb/core")):typeof define=="function"&&define.amd?define(["mobx","@signaldb/core"],n):(e=typeof globalThis<"u"?globalThis:e||self,e.SignalDB=n(e.mobx,e.core))})(this,(function(e,n){"use strict";return n.createReactivityAdapter({create:()=>{const t=e.observable({count:0});return{depend:()=>{t.count},notify:()=>{e.runInAction(()=>{t.count+=1})},raw:t}},isInScope:void 0,onDispose(t,{raw:o}){e.onBecomeUnobserved(o,"count",t)}})}));
2
2
  //# sourceMappingURL=index.umd.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { observable, runInAction, onBecomeUnobserved, } from 'mobx';\nimport { createReactivityAdapter } from '@signaldb/core';\nconst mobxReactivityAdapter = createReactivityAdapter({\n create: () => {\n const dep = observable({ count: 0 });\n return {\n depend: () => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n dep.count;\n },\n notify: () => {\n runInAction(() => {\n dep.count += 1;\n });\n },\n raw: dep,\n };\n },\n isInScope: undefined,\n onDispose(callback, { raw: dep }) {\n onBecomeUnobserved(dep, 'count', callback);\n },\n});\nexport default mobxReactivityAdapter;\n"],"names":["createReactivityAdapter","dep","observable","runInAction","callback","onBecomeUnobserved"],"mappings":"mTAE8BA,EAAAA,wBAAwB,CAClD,OAAQ,IAAM,CACV,MAAMC,EAAMC,EAAA,WAAW,CAAE,MAAO,EAAG,EAC5B,MAAA,CACH,OAAQ,IAAM,CAEND,EAAA,KACR,EACA,OAAQ,IAAM,CACVE,EAAAA,YAAY,IAAM,CACdF,EAAI,OAAS,CAAA,CAChB,CACL,EACA,IAAKA,CACT,CACJ,EACA,UAAW,OACX,UAAUG,EAAU,CAAE,IAAKH,GAAO,CACXI,qBAAAJ,EAAK,QAASG,CAAQ,CAAA,CAEjD,CAAC"}
1
+ {"version":3,"file":"index.umd.js","sources":["../src/index.ts"],"sourcesContent":["import { observable, runInAction, onBecomeUnobserved, } from 'mobx';\nimport { createReactivityAdapter } from '@signaldb/core';\nconst mobxReactivityAdapter = createReactivityAdapter({\n create: () => {\n const dep = observable({ count: 0 });\n return {\n depend: () => {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n dep.count;\n },\n notify: () => {\n runInAction(() => {\n dep.count += 1;\n });\n },\n raw: dep,\n };\n },\n isInScope: undefined,\n onDispose(callback, { raw: dep }) {\n onBecomeUnobserved(dep, 'count', callback);\n },\n});\nexport default mobxReactivityAdapter;\n"],"names":["createReactivityAdapter","dep","observable","runInAction","callback","onBecomeUnobserved"],"mappings":"oTAE8BA,EAAAA,wBAAwB,CAClD,OAAQ,IAAM,CACV,MAAMC,EAAMC,EAAAA,WAAW,CAAE,MAAO,EAAG,EACnC,MAAO,CACH,OAAQ,IAAM,CAEVD,EAAI,KACR,EACA,OAAQ,IAAM,CACVE,EAAAA,YAAY,IAAM,CACdF,EAAI,OAAS,CACjB,CAAC,CACL,EACA,IAAKA,CAAA,CAEb,EACA,UAAW,OACX,UAAUG,EAAU,CAAE,IAAKH,GAAO,CAC9BI,qBAAmBJ,EAAK,QAASG,CAAQ,CAC7C,CACJ,CAAC"}
package/package.json CHANGED
@@ -1,9 +1,11 @@
1
1
  {
2
2
  "name": "@signaldb/mobx",
3
- "version": "1.0.0",
3
+ "version": "2.0.0-beta.2",
4
4
  "description": "",
5
5
  "scripts": {
6
- "build": "rimraf dist && vite build"
6
+ "build": "rimraf dist && vite build",
7
+ "analyze-bundle": "bundle-analyzer ./dist --upload-token=$BUNDLE_ANALYZER_UPLOAD_TOKEN --bundle-name=@signaldb/mobx",
8
+ "test": "vitest"
7
9
  },
8
10
  "repository": {
9
11
  "type": "git",
@@ -50,7 +52,7 @@
50
52
  "dist"
51
53
  ],
52
54
  "peerDependencies": {
53
- "@signaldb/core": "1.x",
55
+ "@signaldb/core": "1.x || ^2.0.0-0",
54
56
  "mobx": "6.x.x"
55
57
  }
56
58
  }