@buoy-gg/redux 7.0.8 → 7.0.10
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/lib/commonjs/redux/utils/autoInstrument.js +4 -0
- package/lib/commonjs/redux/utils/buoyReduxMiddleware.js +4 -0
- package/lib/commonjs/redux/utils/reduxActionStore.js +77 -1
- package/lib/module/redux/utils/autoInstrument.js +5 -1
- package/lib/module/redux/utils/buoyReduxMiddleware.js +5 -1
- package/lib/module/redux/utils/reduxActionStore.js +75 -1
- package/lib/typescript/redux/utils/autoInstrument.d.ts.map +1 -1
- package/lib/typescript/redux/utils/buoyReduxMiddleware.d.ts.map +1 -1
- package/lib/typescript/redux/utils/reduxActionStore.d.ts +16 -0
- package/lib/typescript/redux/utils/reduxActionStore.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -198,6 +198,10 @@ let warnedJumpUnsupported = false;
|
|
|
198
198
|
* that and warn once instead of pretending it worked.
|
|
199
199
|
*/
|
|
200
200
|
function jumpToState(state) {
|
|
201
|
+
if ((0, _reduxActionStore.isEvictedState)(state)) {
|
|
202
|
+
console.warn("[BuoyRedux] Cannot jump - this action's state was evicted (raw state is retained for recent actions only)");
|
|
203
|
+
return;
|
|
204
|
+
}
|
|
201
205
|
const store = (0, _activeStoreRegistry.getActiveStore)();
|
|
202
206
|
if (!store) {
|
|
203
207
|
console.warn("[BuoyRedux] Cannot jump to state - no store instrumented");
|
|
@@ -56,6 +56,10 @@ const BUOY_REPLAY_ACTION = exports.BUOY_REPLAY_ACTION = "@@buoy/REPLAY_ACTION";
|
|
|
56
56
|
* which silently broke the modal's Jump button on the zero-config path.
|
|
57
57
|
*/
|
|
58
58
|
function jumpToState(state) {
|
|
59
|
+
if ((0, _reduxActionStore.isEvictedState)(state)) {
|
|
60
|
+
console.warn("[BuoyRedux] Cannot jump - this action's state was evicted (raw state is retained for recent actions only)");
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
59
63
|
const store = (0, _activeStoreRegistry.getActiveStore)();
|
|
60
64
|
if (store) {
|
|
61
65
|
store.dispatch({
|
|
@@ -3,11 +3,34 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.STATE_RETENTION_LIMIT = exports.STATE_EVICTED = void 0;
|
|
7
|
+
exports.isEvictedState = isEvictedState;
|
|
6
8
|
exports.reduxActionStore = void 0;
|
|
7
9
|
/**
|
|
8
10
|
* Redux action store - captures and stores Redux Toolkit actions
|
|
9
11
|
*/
|
|
10
12
|
|
|
13
|
+
/**
|
|
14
|
+
* How many of the most-recent actions keep their raw prevState/nextState
|
|
15
|
+
* trees. Older actions keep all diff metadata but their trees are replaced
|
|
16
|
+
* with STATE_EVICTED so a store switch can't pin hundreds of MB.
|
|
17
|
+
*/
|
|
18
|
+
const STATE_RETENTION_LIMIT = exports.STATE_RETENTION_LIMIT = 25;
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Sentinel installed in place of evicted state trees. A frozen plain object
|
|
22
|
+
* so existing detail viewers render it harmlessly; jumpToState refuses it.
|
|
23
|
+
*/
|
|
24
|
+
const STATE_EVICTED = exports.STATE_EVICTED = Object.freeze({
|
|
25
|
+
__buoyStateEvicted: true,
|
|
26
|
+
note: `Raw state retained for the ${STATE_RETENTION_LIMIT} most recent actions only.`
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
/** True when a value is the evicted-state sentinel (guards time travel). */
|
|
30
|
+
function isEvictedState(value) {
|
|
31
|
+
return typeof value === "object" && value !== null && value.__buoyStateEvicted === true;
|
|
32
|
+
}
|
|
33
|
+
|
|
11
34
|
// ============================================
|
|
12
35
|
// Helper Functions for Enhanced Data
|
|
13
36
|
// ============================================
|
|
@@ -60,6 +83,39 @@ function parseActionType(type) {
|
|
|
60
83
|
};
|
|
61
84
|
}
|
|
62
85
|
|
|
86
|
+
/**
|
|
87
|
+
* Cheap early-abort size probe: is `value`'s JSON form definitely longer than
|
|
88
|
+
* `limit`? Bails the moment the running estimate exceeds the limit, so the
|
|
89
|
+
* cost is O(limit) — never O(payload). Used to avoid JSON.stringify-ing large
|
|
90
|
+
* payloads (a fulfilled thunk's payload can be megabytes) just to produce a
|
|
91
|
+
* 40-char preview; that full stringify ran on EVERY dispatch and blocked the
|
|
92
|
+
* JS thread at enterprise state sizes.
|
|
93
|
+
*/
|
|
94
|
+
function jsonLongerThan(value, limit) {
|
|
95
|
+
let bytes = 0;
|
|
96
|
+
const stack = [value];
|
|
97
|
+
const seen = new Set();
|
|
98
|
+
while (stack.length > 0) {
|
|
99
|
+
if (bytes > limit) return true;
|
|
100
|
+
const v = stack.pop();
|
|
101
|
+
if (v === null || v === undefined) bytes += 4;else if (typeof v === "string") bytes += v.length + 2;else if (typeof v === "number") bytes += 8;else if (typeof v === "boolean") bytes += 5;else if (typeof v === "object") {
|
|
102
|
+
if (seen.has(v)) continue;
|
|
103
|
+
seen.add(v);
|
|
104
|
+
if (Array.isArray(v)) {
|
|
105
|
+
bytes += 2 + v.length;
|
|
106
|
+
for (let i = 0; i < v.length; i++) stack.push(v[i]);
|
|
107
|
+
} else {
|
|
108
|
+
bytes += 2;
|
|
109
|
+
for (const k in v) {
|
|
110
|
+
bytes += k.length + 4;
|
|
111
|
+
stack.push(v[k]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
} else bytes += 4;
|
|
115
|
+
}
|
|
116
|
+
return bytes > limit;
|
|
117
|
+
}
|
|
118
|
+
|
|
63
119
|
/**
|
|
64
120
|
* Format payload preview for display
|
|
65
121
|
*/
|
|
@@ -75,6 +131,8 @@ function formatPayloadPreview(payload, maxLength = 40) {
|
|
|
75
131
|
}
|
|
76
132
|
if (Array.isArray(payload)) {
|
|
77
133
|
if (payload.length === 0) return "[]";
|
|
134
|
+
// Probe cheaply first — only stringify payloads that can actually fit.
|
|
135
|
+
if (jsonLongerThan(payload, maxLength)) return `[${payload.length} items]`;
|
|
78
136
|
const preview = JSON.stringify(payload);
|
|
79
137
|
return preview.length > maxLength ? `[${payload.length} items]` : preview;
|
|
80
138
|
}
|
|
@@ -82,7 +140,8 @@ function formatPayloadPreview(payload, maxLength = 40) {
|
|
|
82
140
|
const keys = Object.keys(payload);
|
|
83
141
|
if (keys.length === 0) return "{}";
|
|
84
142
|
|
|
85
|
-
//
|
|
143
|
+
// Probe cheaply first — only stringify payloads that can actually fit.
|
|
144
|
+
if (jsonLongerThan(payload, maxLength)) return `{ ${keys.length} keys }`;
|
|
86
145
|
const preview = JSON.stringify(payload);
|
|
87
146
|
if (preview.length <= maxLength) return preview;
|
|
88
147
|
|
|
@@ -218,6 +277,23 @@ class ReduxActionStore {
|
|
|
218
277
|
isSlowAction
|
|
219
278
|
};
|
|
220
279
|
this.actions = [reduxAction, ...this.actions].slice(0, this.maxActions);
|
|
280
|
+
|
|
281
|
+
// Bound raw-state retention. Every action holds prevState/nextState by
|
|
282
|
+
// reference; with structural sharing that's normally cheap, but when a
|
|
283
|
+
// host replaces large slices wholesale (store switch / rehydration),
|
|
284
|
+
// each retained action pins a DISTINCT multi-MB subtree — measured 88MB
|
|
285
|
+
// pinned by 50 slice-replacing actions, enough to OOM-kill enterprise
|
|
286
|
+
// apps. Detail view + time travel realistically use recent actions, so
|
|
287
|
+
// older ones keep their diff metadata but drop the raw trees.
|
|
288
|
+
for (let i = STATE_RETENTION_LIMIT; i < this.actions.length; i++) {
|
|
289
|
+
const a = this.actions[i];
|
|
290
|
+
if (a.prevState !== STATE_EVICTED) {
|
|
291
|
+
a.prevState = STATE_EVICTED;
|
|
292
|
+
a.nextState = STATE_EVICTED;
|
|
293
|
+
} else {
|
|
294
|
+
break; // older entries already evicted (list is newest-first)
|
|
295
|
+
}
|
|
296
|
+
}
|
|
221
297
|
this.notifyListeners();
|
|
222
298
|
}
|
|
223
299
|
getActions() {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* capture as "top-level-only" — see activeStoreRegistry.getInstrumentationStatus.
|
|
16
16
|
*/
|
|
17
17
|
|
|
18
|
-
import { reduxActionStore } from "./reduxActionStore";
|
|
18
|
+
import { reduxActionStore, isEvictedState } from "./reduxActionStore";
|
|
19
19
|
import { BUOY_JUMP_TO_STATE, isMiddlewareActive } from "./buoyReduxMiddleware";
|
|
20
20
|
import { registerActiveStore, unregisterActiveStore, getActiveStore as getRegisteredStore, ENHANCER_SYMBOL } from "./activeStoreRegistry";
|
|
21
21
|
|
|
@@ -183,6 +183,10 @@ let warnedJumpUnsupported = false;
|
|
|
183
183
|
* that and warn once instead of pretending it worked.
|
|
184
184
|
*/
|
|
185
185
|
export function jumpToState(state) {
|
|
186
|
+
if (isEvictedState(state)) {
|
|
187
|
+
console.warn("[BuoyRedux] Cannot jump - this action's state was evicted (raw state is retained for recent actions only)");
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
186
190
|
const store = getRegisteredStore();
|
|
187
191
|
if (!store) {
|
|
188
192
|
console.warn("[BuoyRedux] Cannot jump to state - no store instrumented");
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* ```
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { reduxActionStore } from "./reduxActionStore";
|
|
19
|
+
import { reduxActionStore, isEvictedState } from "./reduxActionStore";
|
|
20
20
|
import { registerActiveStore, getActiveStore } from "./activeStoreRegistry";
|
|
21
21
|
|
|
22
22
|
// ============================================
|
|
@@ -48,6 +48,10 @@ export const BUOY_REPLAY_ACTION = "@@buoy/REPLAY_ACTION";
|
|
|
48
48
|
* which silently broke the modal's Jump button on the zero-config path.
|
|
49
49
|
*/
|
|
50
50
|
export function jumpToState(state) {
|
|
51
|
+
if (isEvictedState(state)) {
|
|
52
|
+
console.warn("[BuoyRedux] Cannot jump - this action's state was evicted (raw state is retained for recent actions only)");
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
51
55
|
const store = getActiveStore();
|
|
52
56
|
if (store) {
|
|
53
57
|
store.dispatch({
|
|
@@ -4,6 +4,27 @@
|
|
|
4
4
|
* Redux action store - captures and stores Redux Toolkit actions
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/**
|
|
8
|
+
* How many of the most-recent actions keep their raw prevState/nextState
|
|
9
|
+
* trees. Older actions keep all diff metadata but their trees are replaced
|
|
10
|
+
* with STATE_EVICTED so a store switch can't pin hundreds of MB.
|
|
11
|
+
*/
|
|
12
|
+
export const STATE_RETENTION_LIMIT = 25;
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Sentinel installed in place of evicted state trees. A frozen plain object
|
|
16
|
+
* so existing detail viewers render it harmlessly; jumpToState refuses it.
|
|
17
|
+
*/
|
|
18
|
+
export const STATE_EVICTED = Object.freeze({
|
|
19
|
+
__buoyStateEvicted: true,
|
|
20
|
+
note: `Raw state retained for the ${STATE_RETENTION_LIMIT} most recent actions only.`
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
/** True when a value is the evicted-state sentinel (guards time travel). */
|
|
24
|
+
export function isEvictedState(value) {
|
|
25
|
+
return typeof value === "object" && value !== null && value.__buoyStateEvicted === true;
|
|
26
|
+
}
|
|
27
|
+
|
|
7
28
|
// ============================================
|
|
8
29
|
// Helper Functions for Enhanced Data
|
|
9
30
|
// ============================================
|
|
@@ -56,6 +77,39 @@ function parseActionType(type) {
|
|
|
56
77
|
};
|
|
57
78
|
}
|
|
58
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Cheap early-abort size probe: is `value`'s JSON form definitely longer than
|
|
82
|
+
* `limit`? Bails the moment the running estimate exceeds the limit, so the
|
|
83
|
+
* cost is O(limit) — never O(payload). Used to avoid JSON.stringify-ing large
|
|
84
|
+
* payloads (a fulfilled thunk's payload can be megabytes) just to produce a
|
|
85
|
+
* 40-char preview; that full stringify ran on EVERY dispatch and blocked the
|
|
86
|
+
* JS thread at enterprise state sizes.
|
|
87
|
+
*/
|
|
88
|
+
function jsonLongerThan(value, limit) {
|
|
89
|
+
let bytes = 0;
|
|
90
|
+
const stack = [value];
|
|
91
|
+
const seen = new Set();
|
|
92
|
+
while (stack.length > 0) {
|
|
93
|
+
if (bytes > limit) return true;
|
|
94
|
+
const v = stack.pop();
|
|
95
|
+
if (v === null || v === undefined) bytes += 4;else if (typeof v === "string") bytes += v.length + 2;else if (typeof v === "number") bytes += 8;else if (typeof v === "boolean") bytes += 5;else if (typeof v === "object") {
|
|
96
|
+
if (seen.has(v)) continue;
|
|
97
|
+
seen.add(v);
|
|
98
|
+
if (Array.isArray(v)) {
|
|
99
|
+
bytes += 2 + v.length;
|
|
100
|
+
for (let i = 0; i < v.length; i++) stack.push(v[i]);
|
|
101
|
+
} else {
|
|
102
|
+
bytes += 2;
|
|
103
|
+
for (const k in v) {
|
|
104
|
+
bytes += k.length + 4;
|
|
105
|
+
stack.push(v[k]);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
} else bytes += 4;
|
|
109
|
+
}
|
|
110
|
+
return bytes > limit;
|
|
111
|
+
}
|
|
112
|
+
|
|
59
113
|
/**
|
|
60
114
|
* Format payload preview for display
|
|
61
115
|
*/
|
|
@@ -71,6 +125,8 @@ function formatPayloadPreview(payload, maxLength = 40) {
|
|
|
71
125
|
}
|
|
72
126
|
if (Array.isArray(payload)) {
|
|
73
127
|
if (payload.length === 0) return "[]";
|
|
128
|
+
// Probe cheaply first — only stringify payloads that can actually fit.
|
|
129
|
+
if (jsonLongerThan(payload, maxLength)) return `[${payload.length} items]`;
|
|
74
130
|
const preview = JSON.stringify(payload);
|
|
75
131
|
return preview.length > maxLength ? `[${payload.length} items]` : preview;
|
|
76
132
|
}
|
|
@@ -78,7 +134,8 @@ function formatPayloadPreview(payload, maxLength = 40) {
|
|
|
78
134
|
const keys = Object.keys(payload);
|
|
79
135
|
if (keys.length === 0) return "{}";
|
|
80
136
|
|
|
81
|
-
//
|
|
137
|
+
// Probe cheaply first — only stringify payloads that can actually fit.
|
|
138
|
+
if (jsonLongerThan(payload, maxLength)) return `{ ${keys.length} keys }`;
|
|
82
139
|
const preview = JSON.stringify(payload);
|
|
83
140
|
if (preview.length <= maxLength) return preview;
|
|
84
141
|
|
|
@@ -214,6 +271,23 @@ class ReduxActionStore {
|
|
|
214
271
|
isSlowAction
|
|
215
272
|
};
|
|
216
273
|
this.actions = [reduxAction, ...this.actions].slice(0, this.maxActions);
|
|
274
|
+
|
|
275
|
+
// Bound raw-state retention. Every action holds prevState/nextState by
|
|
276
|
+
// reference; with structural sharing that's normally cheap, but when a
|
|
277
|
+
// host replaces large slices wholesale (store switch / rehydration),
|
|
278
|
+
// each retained action pins a DISTINCT multi-MB subtree — measured 88MB
|
|
279
|
+
// pinned by 50 slice-replacing actions, enough to OOM-kill enterprise
|
|
280
|
+
// apps. Detail view + time travel realistically use recent actions, so
|
|
281
|
+
// older ones keep their diff metadata but drop the raw trees.
|
|
282
|
+
for (let i = STATE_RETENTION_LIMIT; i < this.actions.length; i++) {
|
|
283
|
+
const a = this.actions[i];
|
|
284
|
+
if (a.prevState !== STATE_EVICTED) {
|
|
285
|
+
a.prevState = STATE_EVICTED;
|
|
286
|
+
a.nextState = STATE_EVICTED;
|
|
287
|
+
} else {
|
|
288
|
+
break; // older entries already evicted (list is newest-first)
|
|
289
|
+
}
|
|
290
|
+
}
|
|
217
291
|
this.notifyListeners();
|
|
218
292
|
}
|
|
219
293
|
getActions() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"autoInstrument.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/autoInstrument.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAG7D,OAAO,EAKL,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EACL,wBAAwB,EACxB,KAAK,qBAAqB,EAC1B,KAAK,gBAAgB,GACtB,MAAM,uBAAuB,CAAC;AAsB/B,MAAM,WAAW,qBAAqB;IACpC;;;;OAIG;IACH,gBAAgB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;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC7B,KAAK,EAAE,KAAK,EACZ,OAAO,GAAE,qBAA0B,GAClC,MAAM,IAAI,CAuFZ;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAapD;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,EACZ,OAAO,GAAE,qBAA0B,GAClC,MAAM,IAAI,CAEZ;AASD;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CA0BhD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAOxD;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,IAAI,gBAAgB,GAAG,IAAI,CAExD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAEhD"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buoyReduxMiddleware.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/buoyReduxMiddleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAc3D;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAMD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAczD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"buoyReduxMiddleware.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/buoyReduxMiddleware.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,UAAU,CAAC;AAc3D;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAMD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AACzD,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAczD;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAahD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAOxD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAWnE;AAED;;GAEG;AACH,eAAO,MAAM,mBAAmB,EAAE,UA4BjC,CAAC;AAEF;;GAEG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,GAAE,0BAA+B,GACvC,UAAU,CAoCZ"}
|
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
* Redux action store - captures and stores Redux Toolkit actions
|
|
3
3
|
*/
|
|
4
4
|
import type { ReduxAction, ReduxFilter } from "../types";
|
|
5
|
+
/**
|
|
6
|
+
* How many of the most-recent actions keep their raw prevState/nextState
|
|
7
|
+
* trees. Older actions keep all diff metadata but their trees are replaced
|
|
8
|
+
* with STATE_EVICTED so a store switch can't pin hundreds of MB.
|
|
9
|
+
*/
|
|
10
|
+
export declare const STATE_RETENTION_LIMIT = 25;
|
|
11
|
+
/**
|
|
12
|
+
* Sentinel installed in place of evicted state trees. A frozen plain object
|
|
13
|
+
* so existing detail viewers render it harmlessly; jumpToState refuses it.
|
|
14
|
+
*/
|
|
15
|
+
export declare const STATE_EVICTED: Readonly<{
|
|
16
|
+
__buoyStateEvicted: true;
|
|
17
|
+
note: "Raw state retained for the 25 most recent actions only.";
|
|
18
|
+
}>;
|
|
19
|
+
/** True when a value is the evicted-state sentinel (guards time travel). */
|
|
20
|
+
export declare function isEvictedState(value: unknown): boolean;
|
|
5
21
|
declare class ReduxActionStore {
|
|
6
22
|
private actions;
|
|
7
23
|
private listeners;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reduxActionStore.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/reduxActionStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAA8B,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"reduxActionStore.d.ts","sourceRoot":"","sources":["../../../../src/redux/utils/reduxActionStore.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAA8B,MAAM,UAAU,CAAC;AAErF;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,KAAK,CAAC;AAExC;;;GAGG;AACH,eAAO,MAAM,aAAa;;;EAGxB,CAAC;AAEH,4EAA4E;AAC5E,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAMtD;AAyND,cAAM,gBAAgB;IACpB,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,SAAS,CAAoD;IACrE,OAAO,CAAC,cAAc,CAA8B;IACpD,OAAO,CAAC,UAAU,CAAO;IACzB,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,SAAS,CAAQ;IACzB,OAAO,CAAC,iBAAiB,CAAS;IAElC,SAAS,CACP,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,SAAS,EAAE,OAAO,EAClB,SAAS,EAAE,OAAO,EAClB,QAAQ,CAAC,EAAE,MAAM,GAChB,IAAI;IAyEP,UAAU,IAAI,WAAW,EAAE;IAI3B,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,WAAW,GA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Tools inside your React Native app — action log, state diffs & time travel with zero store changes. Part of Buoy devtools.",
|
|
5
5
|
"main": "lib/commonjs/index.js",
|
|
6
6
|
"module": "lib/module/index.js",
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
"**/devtoolsHook.ts"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@buoy-gg/shared-ui": "7.0.
|
|
33
|
-
"@buoy-gg/floating-tools-core": "7.0.
|
|
34
|
-
"@buoy-gg/license": "7.0.
|
|
32
|
+
"@buoy-gg/shared-ui": "^7.0.10",
|
|
33
|
+
"@buoy-gg/floating-tools-core": "^7.0.10",
|
|
34
|
+
"@buoy-gg/license": "^7.0.10"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@reduxjs/toolkit": ">=1.9.0",
|