@legendapp/state 3.0.0-alpha.29 → 3.0.0-alpha.30
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/config/enable$GetSet.js +2 -1
- package/config/enable$GetSet.mjs +2 -1
- package/config/enableReactTracking.js +2 -1
- package/config/enableReactTracking.mjs +2 -1
- package/config/enableReactUse.js +2 -1
- package/config/enableReactUse.mjs +2 -1
- package/config/enable_PeekAssign.js +2 -1
- package/config/enable_PeekAssign.mjs +2 -1
- package/config.d.mts +13 -0
- package/config.d.ts +13 -0
- package/config.js +2052 -0
- package/config.mjs +2050 -0
- package/index.d.mts +5 -302
- package/index.d.ts +5 -302
- package/index.js +27 -142
- package/index.mjs +28 -141
- package/observableInterfaces-Dilj6F92.d.mts +282 -0
- package/observableInterfaces-Dilj6F92.d.ts +282 -0
- package/package.json +6 -1
- package/persist-plugins/async-storage.d.mts +6 -3
- package/persist-plugins/async-storage.d.ts +6 -3
- package/persist-plugins/async-storage.js +12 -4
- package/persist-plugins/async-storage.mjs +12 -5
- package/persist-plugins/indexeddb.d.mts +6 -4
- package/persist-plugins/indexeddb.d.ts +6 -4
- package/persist-plugins/indexeddb.js +15 -5
- package/persist-plugins/indexeddb.mjs +15 -6
- package/persist-plugins/mmkv.d.mts +5 -1
- package/persist-plugins/mmkv.d.ts +5 -1
- package/persist-plugins/mmkv.js +14 -5
- package/persist-plugins/mmkv.mjs +14 -6
- package/react.d.mts +1 -0
- package/react.d.ts +1 -0
- package/react.js +2 -2
- package/react.mjs +2 -2
- package/sync-plugins/crud.d.mts +1 -1
- package/sync-plugins/crud.d.ts +1 -1
- package/sync-plugins/fetch.js +12 -8
- package/sync-plugins/fetch.mjs +13 -9
- package/sync-plugins/keel.d.mts +2 -2
- package/sync-plugins/keel.d.ts +2 -2
- package/sync-plugins/keel.js +6 -6
- package/sync-plugins/keel.mjs +6 -6
- package/sync.d.mts +37 -19
- package/sync.d.ts +37 -19
- package/sync.js +143 -41
- package/sync.mjs +151 -50
package/config/enable$GetSet.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var state = require('@legendapp/state');
|
|
4
|
+
var config = require('@legendapp/state/config');
|
|
4
5
|
|
|
5
6
|
// src/config/enable$GetSet.ts
|
|
6
7
|
function enable$GetSet() {
|
|
7
|
-
|
|
8
|
+
config.configureLegendState({
|
|
8
9
|
observableProperties: {
|
|
9
10
|
$: {
|
|
10
11
|
get(node) {
|
package/config/enable$GetSet.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var state = require('@legendapp/state');
|
|
4
|
+
var config = require('@legendapp/state/config');
|
|
4
5
|
var react$1 = require('@legendapp/state/react');
|
|
5
6
|
var react = require('react');
|
|
6
7
|
|
|
@@ -22,7 +23,7 @@ function enableReactTracking({ auto, warnUnobserved }) {
|
|
|
22
23
|
}
|
|
23
24
|
return false;
|
|
24
25
|
};
|
|
25
|
-
|
|
26
|
+
config.configureLegendState({
|
|
26
27
|
observableFunctions: {
|
|
27
28
|
get: (node, options) => {
|
|
28
29
|
if (needsSelector()) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { isObject, internal, tracking } from '@legendapp/state';
|
|
2
|
+
import { configureLegendState } from '@legendapp/state/config';
|
|
2
3
|
import { useSelector } from '@legendapp/state/react';
|
|
3
4
|
import { createContext, __SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED, useContext } from 'react';
|
|
4
5
|
|
package/config/enableReactUse.js
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var state = require('@legendapp/state');
|
|
4
|
+
var config = require('@legendapp/state/config');
|
|
4
5
|
var react = require('@legendapp/state/react');
|
|
5
6
|
|
|
6
7
|
// src/config/enableReactUse.ts
|
|
7
8
|
var didWarn = false;
|
|
8
9
|
function enableReactUse() {
|
|
9
|
-
|
|
10
|
+
config.configureLegendState({
|
|
10
11
|
observableFunctions: {
|
|
11
12
|
use: (node, options) => {
|
|
12
13
|
if (process.env.NODE_ENV === "development" && !didWarn) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { internal } from '@legendapp/state';
|
|
2
|
+
import { configureLegendState } from '@legendapp/state/config';
|
|
2
3
|
import { useSelector } from '@legendapp/state/react';
|
|
3
4
|
|
|
4
5
|
// src/config/enableReactUse.ts
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var state = require('@legendapp/state');
|
|
4
|
+
var config = require('@legendapp/state/config');
|
|
4
5
|
|
|
5
6
|
// src/config/enable_PeekAssign.ts
|
|
6
7
|
function enable_PeekAssign() {
|
|
7
|
-
|
|
8
|
+
config.configureLegendState({
|
|
8
9
|
observableProperties: {
|
|
9
10
|
_: {
|
|
10
11
|
get(node) {
|
package/config.d.mts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { N as NodeInfo } from './observableInterfaces-Dilj6F92.mjs';
|
|
2
|
+
|
|
3
|
+
declare function configureLegendState({ observableFunctions, observableProperties, jsonReplacer, jsonReviver, }: {
|
|
4
|
+
observableFunctions?: Record<string, (node: NodeInfo, ...args: any[]) => any>;
|
|
5
|
+
observableProperties?: Record<string, {
|
|
6
|
+
get: (node: NodeInfo) => any;
|
|
7
|
+
set: (node: NodeInfo, value: any) => any;
|
|
8
|
+
}>;
|
|
9
|
+
jsonReplacer?: (this: any, key: string, value: any) => any;
|
|
10
|
+
jsonReviver?: (this: any, key: string, value: any) => any;
|
|
11
|
+
}): void;
|
|
12
|
+
|
|
13
|
+
export { configureLegendState };
|
package/config.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { N as NodeInfo } from './observableInterfaces-Dilj6F92.js';
|
|
2
|
+
|
|
3
|
+
declare function configureLegendState({ observableFunctions, observableProperties, jsonReplacer, jsonReviver, }: {
|
|
4
|
+
observableFunctions?: Record<string, (node: NodeInfo, ...args: any[]) => any>;
|
|
5
|
+
observableProperties?: Record<string, {
|
|
6
|
+
get: (node: NodeInfo) => any;
|
|
7
|
+
set: (node: NodeInfo, value: any) => any;
|
|
8
|
+
}>;
|
|
9
|
+
jsonReplacer?: (this: any, key: string, value: any) => any;
|
|
10
|
+
jsonReviver?: (this: any, key: string, value: any) => any;
|
|
11
|
+
}): void;
|
|
12
|
+
|
|
13
|
+
export { configureLegendState };
|