mobx-solid 0.1.0 → 0.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"enable-observable-tracking.d.ts","sourceRoot":"","sources":["../src/enable-observable-tracking.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;CAsBpC,CAAA"}
1
+ {"version":3,"file":"enable-observable-tracking.d.ts","sourceRoot":"","sources":["../src/enable-observable-tracking.ts"],"names":[],"mappings":"AA8BA;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;CAkBpC,CAAA"}
package/dist/index.js CHANGED
@@ -1,34 +1,31 @@
1
- import { Reaction as u, untracked as i, reaction as l } from "mobx";
2
- import { enableExternalSource as f, createSignal as a, untrack as b, onCleanup as d } from "solid-js";
3
- const p = "mobx-solid", s = () => {
4
- s._ || (s._ = !0, f(
5
- (e, n) => {
6
- const t = new u(p, n);
7
- return {
8
- track: (r) => {
9
- let o;
10
- return t.track(() => {
11
- o = e(r);
12
- }), o;
13
- },
14
- dispose: () => t.dispose()
15
- };
1
+ import { untracked as s, Reaction as f, reaction as d } from "mobx";
2
+ import { createResource as p, enableExternalSource as c, createSignal as i, untrack as b, onCleanup as S } from "solid-js";
3
+ const k = "mobx-solid", u = (e, n) => {
4
+ const t = new f(k, n);
5
+ return {
6
+ track: (r) => {
7
+ let o;
8
+ return t.track(() => {
9
+ o = e(r);
10
+ }), o;
16
11
  },
17
- i
18
- ));
12
+ dispose: () => t.dispose()
13
+ };
14
+ }, a = () => {
15
+ a._ || (a._ = !0, typeof p > "u" ? c({ factory: u, untrack: s }) : c(u, s));
19
16
  };
20
- s._ = !1;
21
- const c = { equals: !1 }, m = { equals: () => !1 };
22
- function S(e) {
23
- const [n] = a(e(), c);
17
+ a._ = !1;
18
+ const l = { equals: !1 }, m = { equals: () => !1 };
19
+ function _(e) {
20
+ const [n] = i(e(), l);
24
21
  return n;
25
22
  }
26
- function _(e) {
27
- const [n, t] = a(b(e), c), r = l(e, (o) => t(() => o), m);
28
- return d(r), n;
23
+ function x(e) {
24
+ const [n, t] = i(b(e), l), r = d(e, (o) => t(() => o), m);
25
+ return S(r), n;
29
26
  }
30
- const v = typeof window > "u" ? S : _;
27
+ const v = typeof window > "u" ? _ : x;
31
28
  export {
32
- s as enableObservableTracking,
29
+ a as enableObservableTracking,
33
30
  v as obs
34
31
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mobx-solid",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "description": "⚡ MobX bindings for SolidJS — reactive state management with fine-grained UI updates (~0.4 kB gzip)",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -29,7 +29,7 @@
29
29
  },
30
30
  "peerDependencies": {
31
31
  "mobx": "^6.0.0",
32
- "solid-js": "^1.6.0"
32
+ "solid-js": "^1.6.0 || ^2.0.0-0"
33
33
  },
34
34
  "devDependencies": {
35
35
  "@changesets/changelog-github": "^0.7.0",