@yaasl/devtools 0.11.0-alpha.2 → 0.11.0-alpha.3
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/cjs/redux-devtools/ExtensionOptions.js +1 -0
- package/dist/cjs/redux-devtools/getReduxExtension.js +3 -0
- package/dist/cjs/utils/subscribeStore.js +3 -3
- package/dist/esm/redux-devtools/ExtensionOptions.js +1 -0
- package/dist/esm/redux-devtools/getReduxExtension.js +4 -1
- package/dist/esm/utils/subscribeStore.js +3 -3
- package/package.json +3 -8
- package/tsconfig.json +0 -3
- package/tsconfig.node.json +0 -9
|
@@ -5,6 +5,9 @@ const utils_1 = require("@yaasl/utils");
|
|
|
5
5
|
let didWarn = false;
|
|
6
6
|
/** Returns the global redux extension object if available */
|
|
7
7
|
const getReduxExtension = () => {
|
|
8
|
+
const window = (0, utils_1.getWindow)();
|
|
9
|
+
if (!window)
|
|
10
|
+
return null;
|
|
8
11
|
const reduxExtension = window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
9
12
|
if (!reduxExtension) {
|
|
10
13
|
if (!didWarn) {
|
|
@@ -30,10 +30,10 @@ const subscribeStore = (atom, connection) => {
|
|
|
30
30
|
return;
|
|
31
31
|
didInit = true;
|
|
32
32
|
connection.subscribe(action => {
|
|
33
|
-
const { payload } = action;
|
|
34
|
-
const nextState = !
|
|
33
|
+
const { payload, state } = action;
|
|
34
|
+
const nextState = !state
|
|
35
35
|
? null
|
|
36
|
-
: JSON.parse(
|
|
36
|
+
: JSON.parse(state);
|
|
37
37
|
switch (payload === null || payload === void 0 ? void 0 : payload.type) {
|
|
38
38
|
case "COMMIT":
|
|
39
39
|
connection.init(cache_1.cache.getStore());
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { log } from "@yaasl/utils";
|
|
1
|
+
import { getWindow, log } from "@yaasl/utils";
|
|
2
2
|
let didWarn = false;
|
|
3
3
|
/** Returns the global redux extension object if available */
|
|
4
4
|
export const getReduxExtension = () => {
|
|
5
|
+
const window = getWindow();
|
|
6
|
+
if (!window)
|
|
7
|
+
return null;
|
|
5
8
|
const reduxExtension = window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
6
9
|
if (!reduxExtension) {
|
|
7
10
|
if (!didWarn) {
|
|
@@ -27,10 +27,10 @@ export const subscribeStore = (atom, connection) => {
|
|
|
27
27
|
return;
|
|
28
28
|
didInit = true;
|
|
29
29
|
connection.subscribe(action => {
|
|
30
|
-
const { payload } = action;
|
|
31
|
-
const nextState = !
|
|
30
|
+
const { payload, state } = action;
|
|
31
|
+
const nextState = !state
|
|
32
32
|
? null
|
|
33
|
-
: JSON.parse(
|
|
33
|
+
: JSON.parse(state);
|
|
34
34
|
switch (payload?.type) {
|
|
35
35
|
case "COMMIT":
|
|
36
36
|
connection.init(cache.getStore());
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yaasl/devtools",
|
|
3
|
-
"version": "0.11.0-alpha.
|
|
3
|
+
"version": "0.11.0-alpha.3",
|
|
4
4
|
"description": "yaasl debugging tools (e.g. redux-devtools-extension middleware)",
|
|
5
5
|
"author": "PrettyCoffee",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,13 +38,8 @@
|
|
|
38
38
|
"validate": "run-s lint test build"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@yaasl/core": "0.11.0-alpha.
|
|
42
|
-
"@yaasl/utils": "0.11.0-alpha.
|
|
43
|
-
},
|
|
44
|
-
"eslintConfig": {
|
|
45
|
-
"extends": [
|
|
46
|
-
"../../.eslintrc"
|
|
47
|
-
]
|
|
41
|
+
"@yaasl/core": "0.11.0-alpha.3",
|
|
42
|
+
"@yaasl/utils": "0.11.0-alpha.3"
|
|
48
43
|
},
|
|
49
44
|
"lint-staged": {
|
|
50
45
|
"*.{ts,tsx}": [
|
package/tsconfig.json
DELETED