@signaldb/mobx 1.0.0 → 2.0.0-beta.1
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 +4 -4
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +5 -3
package/dist/index.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
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 =
|
|
5
|
+
const e = n({ count: 0 });
|
|
6
6
|
return {
|
|
7
7
|
depend: () => {
|
|
8
8
|
e.count;
|
|
9
9
|
},
|
|
10
10
|
notify: () => {
|
|
11
|
-
|
|
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
|
-
|
|
20
|
+
t(o, "count", e);
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
export {
|
package/dist/index.mjs.map
CHANGED
|
@@ -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;
|
|
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
|
package/dist/index.umd.js.map
CHANGED
|
@@ -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":"
|
|
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": "
|
|
3
|
+
"version": "2.0.0-beta.1",
|
|
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
|
}
|