MCPcopy
hub / github.com/redux-zero/redux-zero / devtoolsMiddleware

Function devtoolsMiddleware

src/devtools/devtoolsMiddleware.ts:113–131  ·  view source on GitHub ↗
(store: Store)

Source from the content-addressed store, hash-verified

111}
112
113const devtoolsMiddleware = (store: Store) => (next: Function, args: any) => (
114 action: Action
115) => {
116 let result = next(action);
117 subscribe(store, devtoolsMiddleware as { initialized?: boolean });
118 getOrAddAction(action, () => next(action));
119 const reduxAction: ReduxAction = { type: action.name, args: args };
120 if (result && result.then) {
121 return result.then(
122 () =>
123 devTools.instance &&
124 devTools.instance.send(reduxAction, store.getState())
125 );
126 }
127 if (devTools.instance) {
128 devTools.instance.send(reduxAction, store.getState());
129 }
130 return result;
131};
132
133if (typeof window === "object" && (<any>window).__REDUX_DEVTOOLS_EXTENSION__) {
134 connect = function(initialState: object, options: object) {

Callers

nothing calls this directly

Calls 3

getOrAddActionFunction · 0.85
getStateMethod · 0.80
subscribeFunction · 0.70

Tested by

no test coverage detected