@zeniai/client-epic-state 4.19.56-betaAR99 → 4.19.56
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/configureStore.js +3 -5
- package/lib/esm/configureStore.js +3 -5
- package/lib/esm/index.js +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +32 -34
- package/lib/tsconfig.typecheck.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/lib/debugger/eventStore.d.ts +0 -13
- package/lib/debugger/eventStore.js +0 -26
- package/lib/debugger/reduxDebuggerMiddleware.d.ts +0 -6
- package/lib/debugger/reduxDebuggerMiddleware.js +0 -25
- package/lib/debugger/types.d.ts +0 -24
- package/lib/debugger/types.js +0 -2
- package/lib/debugger/wrapRootEpic.d.ts +0 -7
- package/lib/debugger/wrapRootEpic.js +0 -19
- package/lib/esm/debugger/eventStore.js +0 -23
- package/lib/esm/debugger/reduxDebuggerMiddleware.js +0 -21
- package/lib/esm/debugger/types.js +0 -1
- package/lib/esm/debugger/wrapRootEpic.js +0 -16
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zeniai/client-epic-state",
|
|
3
|
-
"version": "4.19.56
|
|
3
|
+
"version": "4.19.56",
|
|
4
4
|
"description": "Shared module between Web & Mobile containing required abstractions for state management, async network communication. ",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib/esm/index.js",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { DebugEvent } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* In-memory store for debug events. Subscribers are notified whenever a new event is added.
|
|
4
|
-
*/
|
|
5
|
-
declare class DebugEventStore {
|
|
6
|
-
private events;
|
|
7
|
-
private listeners;
|
|
8
|
-
add(event: DebugEvent): void;
|
|
9
|
-
getEvents(): DebugEvent[];
|
|
10
|
-
subscribe(listener: (events: DebugEvent[]) => void): () => void;
|
|
11
|
-
}
|
|
12
|
-
export declare const debugEventStore: DebugEventStore;
|
|
13
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.debugEventStore = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* In-memory store for debug events. Subscribers are notified whenever a new event is added.
|
|
6
|
-
*/
|
|
7
|
-
class DebugEventStore {
|
|
8
|
-
constructor() {
|
|
9
|
-
this.events = [];
|
|
10
|
-
this.listeners = [];
|
|
11
|
-
}
|
|
12
|
-
add(event) {
|
|
13
|
-
this.events.push(event);
|
|
14
|
-
this.listeners.forEach((l) => l(this.events));
|
|
15
|
-
}
|
|
16
|
-
getEvents() {
|
|
17
|
-
return this.events;
|
|
18
|
-
}
|
|
19
|
-
subscribe(listener) {
|
|
20
|
-
this.listeners.push(listener);
|
|
21
|
-
return () => {
|
|
22
|
-
this.listeners = this.listeners.filter((l) => l !== listener);
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.debugEventStore = new DebugEventStore();
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.reduxDebuggerMiddleware = void 0;
|
|
4
|
-
const eventStore_1 = require("./eventStore");
|
|
5
|
-
/**
|
|
6
|
-
* Redux middleware that records ACTION_DISPATCHED before the action is processed
|
|
7
|
-
* and STATE_CHANGED after reducers have run.
|
|
8
|
-
*/
|
|
9
|
-
const reduxDebuggerMiddleware = (store) => (next) => (action) => {
|
|
10
|
-
void store;
|
|
11
|
-
eventStore_1.debugEventStore.add({
|
|
12
|
-
type: 'ACTION_DISPATCHED',
|
|
13
|
-
actionType: action.type,
|
|
14
|
-
payload: action.payload,
|
|
15
|
-
timestamp: Date.now(),
|
|
16
|
-
});
|
|
17
|
-
const result = next(action);
|
|
18
|
-
eventStore_1.debugEventStore.add({
|
|
19
|
-
type: 'STATE_CHANGED',
|
|
20
|
-
actionType: action.type,
|
|
21
|
-
timestamp: Date.now(),
|
|
22
|
-
});
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
exports.reduxDebuggerMiddleware = reduxDebuggerMiddleware;
|
package/lib/debugger/types.d.ts
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Debug event types for the Redux + RxJS Time Machine Debugger.
|
|
3
|
-
* Every action, epic emission, and reducer change leaves a breadcrumb in the timeline.
|
|
4
|
-
*/
|
|
5
|
-
export type DebugEvent = {
|
|
6
|
-
actionType: string;
|
|
7
|
-
timestamp: number;
|
|
8
|
-
type: 'ACTION_DISPATCHED';
|
|
9
|
-
payload?: unknown;
|
|
10
|
-
} | {
|
|
11
|
-
actionType: string;
|
|
12
|
-
epicName: string;
|
|
13
|
-
timestamp: number;
|
|
14
|
-
type: 'EPIC_TRIGGERED';
|
|
15
|
-
} | {
|
|
16
|
-
actionType: string;
|
|
17
|
-
epicName: string;
|
|
18
|
-
timestamp: number;
|
|
19
|
-
type: 'EPIC_EMIT';
|
|
20
|
-
} | {
|
|
21
|
-
actionType: string;
|
|
22
|
-
timestamp: number;
|
|
23
|
-
type: 'STATE_CHANGED';
|
|
24
|
-
};
|
package/lib/debugger/types.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { Action } from 'redux';
|
|
2
|
-
import { Epic } from 'redux-observable';
|
|
3
|
-
/**
|
|
4
|
-
* Wraps a root epic so that every action emitted by the epic is recorded as EPIC_EMIT.
|
|
5
|
-
* Used to instrument the combined epic tree without modifying individual epics.
|
|
6
|
-
*/
|
|
7
|
-
export declare function wrapRootEpic<T extends Action, O extends T, S, D>(epic: Epic<T, O, S, D>, epicName?: string): Epic<T, O, S, D>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.wrapRootEpic = wrapRootEpic;
|
|
4
|
-
const operators_1 = require("rxjs/operators");
|
|
5
|
-
const eventStore_1 = require("./eventStore");
|
|
6
|
-
/**
|
|
7
|
-
* Wraps a root epic so that every action emitted by the epic is recorded as EPIC_EMIT.
|
|
8
|
-
* Used to instrument the combined epic tree without modifying individual epics.
|
|
9
|
-
*/
|
|
10
|
-
function wrapRootEpic(epic, epicName = 'root') {
|
|
11
|
-
return (action$, state$, dependencies) => epic(action$, state$, dependencies).pipe((0, operators_1.tap)((action) => {
|
|
12
|
-
eventStore_1.debugEventStore.add({
|
|
13
|
-
type: 'EPIC_EMIT',
|
|
14
|
-
epicName,
|
|
15
|
-
actionType: action.type,
|
|
16
|
-
timestamp: Date.now(),
|
|
17
|
-
});
|
|
18
|
-
}));
|
|
19
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* In-memory store for debug events. Subscribers are notified whenever a new event is added.
|
|
3
|
-
*/
|
|
4
|
-
class DebugEventStore {
|
|
5
|
-
constructor() {
|
|
6
|
-
this.events = [];
|
|
7
|
-
this.listeners = [];
|
|
8
|
-
}
|
|
9
|
-
add(event) {
|
|
10
|
-
this.events.push(event);
|
|
11
|
-
this.listeners.forEach((l) => l(this.events));
|
|
12
|
-
}
|
|
13
|
-
getEvents() {
|
|
14
|
-
return this.events;
|
|
15
|
-
}
|
|
16
|
-
subscribe(listener) {
|
|
17
|
-
this.listeners.push(listener);
|
|
18
|
-
return () => {
|
|
19
|
-
this.listeners = this.listeners.filter((l) => l !== listener);
|
|
20
|
-
};
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
export const debugEventStore = new DebugEventStore();
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { debugEventStore } from './eventStore';
|
|
2
|
-
/**
|
|
3
|
-
* Redux middleware that records ACTION_DISPATCHED before the action is processed
|
|
4
|
-
* and STATE_CHANGED after reducers have run.
|
|
5
|
-
*/
|
|
6
|
-
export const reduxDebuggerMiddleware = (store) => (next) => (action) => {
|
|
7
|
-
void store;
|
|
8
|
-
debugEventStore.add({
|
|
9
|
-
type: 'ACTION_DISPATCHED',
|
|
10
|
-
actionType: action.type,
|
|
11
|
-
payload: action.payload,
|
|
12
|
-
timestamp: Date.now(),
|
|
13
|
-
});
|
|
14
|
-
const result = next(action);
|
|
15
|
-
debugEventStore.add({
|
|
16
|
-
type: 'STATE_CHANGED',
|
|
17
|
-
actionType: action.type,
|
|
18
|
-
timestamp: Date.now(),
|
|
19
|
-
});
|
|
20
|
-
return result;
|
|
21
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { tap } from 'rxjs/operators';
|
|
2
|
-
import { debugEventStore } from './eventStore';
|
|
3
|
-
/**
|
|
4
|
-
* Wraps a root epic so that every action emitted by the epic is recorded as EPIC_EMIT.
|
|
5
|
-
* Used to instrument the combined epic tree without modifying individual epics.
|
|
6
|
-
*/
|
|
7
|
-
export function wrapRootEpic(epic, epicName = 'root') {
|
|
8
|
-
return (action$, state$, dependencies) => epic(action$, state$, dependencies).pipe(tap((action) => {
|
|
9
|
-
debugEventStore.add({
|
|
10
|
-
type: 'EPIC_EMIT',
|
|
11
|
-
epicName,
|
|
12
|
-
actionType: action.type,
|
|
13
|
-
timestamp: Date.now(),
|
|
14
|
-
});
|
|
15
|
-
}));
|
|
16
|
-
}
|