reactotron-redux
Advanced tools
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = createCommandHandler; | ||
| var _reactotronCoreClient = require("reactotron-core-client"); | ||
| var _stateCleaner = _interopRequireDefault(require("./helpers/stateCleaner")); | ||
| var _pathObject = _interopRequireDefault(require("./helpers/pathObject")); | ||
| var _subscriptionsHandler = _interopRequireDefault(require("./subscriptionsHandler")); | ||
| function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | ||
| function createCommandHandler(reactotron, pluginConfig, onReduxStoreCreation) { | ||
| // make sure have loaded the StateResponsePlugin | ||
| (0, _reactotronCoreClient.assertHasStateResponsePlugin)(reactotron); | ||
| const client = reactotron; | ||
| // create our subscriptions handler | ||
| const subscriptionsHandler = (0, _subscriptionsHandler.default)(reactotron, onReduxStoreCreation); | ||
| return ({ | ||
| type, | ||
| payload | ||
| }) => { | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| const reduxStore = client.reduxStore; | ||
| switch (type) { | ||
| // client is asking for keys | ||
| case "state.keys.request": | ||
| case "state.values.request": | ||
| { | ||
| const cleanedState = (0, _stateCleaner.default)(reduxStore.getState()); | ||
| if (!payload.path) { | ||
| client.stateKeysResponse(null, type === "state.keys.request" ? Object.keys(cleanedState) : cleanedState); | ||
| } else { | ||
| const filteredObj = (0, _pathObject.default)(payload.path, cleanedState); | ||
| const responseMethod = type === "state.keys.request" ? client.stateKeysResponse : client.stateValuesResponse; | ||
| responseMethod(payload.path, type === "state.keys.request" ? typeof filteredObj === "object" ? Object.keys(filteredObj) : undefined : filteredObj); | ||
| } | ||
| } | ||
| break; | ||
| // client is asking to subscribe to some paths | ||
| case "state.values.subscribe": | ||
| subscriptionsHandler.setSubscriptions(payload.paths); | ||
| subscriptionsHandler.sendSubscriptions(); | ||
| break; | ||
| // server is asking to dispatch this action | ||
| case "state.action.dispatch": | ||
| reduxStore.dispatch(payload.action); | ||
| break; | ||
| // server is asking to backup state | ||
| case "state.backup.request": | ||
| { | ||
| // run our state through our onBackup | ||
| let backedUpState = reduxStore.getState(); | ||
| if (pluginConfig.onBackup) { | ||
| backedUpState = pluginConfig.onBackup(backedUpState); | ||
| } | ||
| client.send("state.backup.response", { | ||
| state: backedUpState | ||
| }); | ||
| break; | ||
| } | ||
| // server is asking to clobber state with this | ||
| case "state.restore.request": | ||
| { | ||
| // run our state through our onRestore | ||
| let restoredState = payload.state; | ||
| if (pluginConfig.onRestore) { | ||
| restoredState = pluginConfig.onRestore(payload.state, reduxStore.getState()); | ||
| } | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| client.reduxStore.dispatch({ | ||
| type: pluginConfig.restoreActionType, | ||
| state: restoredState | ||
| }); | ||
| break; | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| //# sourceMappingURL=commandHandler.js.map |
| {"version":3,"names":["_reactotronCoreClient","require","_stateCleaner","_interopRequireDefault","_pathObject","_subscriptionsHandler","e","__esModule","default","createCommandHandler","reactotron","pluginConfig","onReduxStoreCreation","assertHasStateResponsePlugin","client","subscriptionsHandler","createSubscriptionsHandler","type","payload","reduxStore","cleanedState","stateCleaner","getState","path","stateKeysResponse","Object","keys","filteredObj","pathObject","responseMethod","stateValuesResponse","undefined","setSubscriptions","paths","sendSubscriptions","dispatch","action","backedUpState","onBackup","send","state","restoredState","onRestore","restoreActionType"],"sourceRoot":"../../src","sources":["commandHandler.ts"],"mappings":";;;;;;AAAA,IAAAA,qBAAA,GAAAC,OAAA;AAOA,IAAAC,aAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,WAAA,GAAAD,sBAAA,CAAAF,OAAA;AACA,IAAAI,qBAAA,GAAAF,sBAAA,CAAAF,OAAA;AAA+D,SAAAE,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGhD,SAASG,oBAAoBA,CAC1CC,UAAkB,EAClBC,YAA0B,EAC1BC,oBAAgD,EAChD;EACA;EACA,IAAAC,kDAA4B,EAACH,UAAU,CAAC;EACxC,MAAMI,MAAM,GAAGJ,UAAiE;;EAEhF;EACA,MAAMK,oBAAoB,GAAG,IAAAC,6BAA0B,EAACN,UAAU,EAAEE,oBAAoB,CAAC;EAEzF,OAAO,CAAC;IAAEK,IAAI;IAAEC;EAAyC,CAAC,KAAK;IAC7D;IACA;IACA,MAAMC,UAAU,GAAGL,MAAM,CAACK,UAAU;IAEpC,QAAQF,IAAI;MACV;MACA,KAAK,oBAAoB;MACzB,KAAK,sBAAsB;QACzB;UACE,MAAMG,YAAY,GAAG,IAAAC,qBAAY,EAACF,UAAU,CAACG,QAAQ,CAAC,CAAC,CAAC;UAExD,IAAI,CAACJ,OAAO,CAACK,IAAI,EAAE;YACjBT,MAAM,CAACU,iBAAiB,CACtB,IAAI,EACJP,IAAI,KAAK,oBAAoB,GAAGQ,MAAM,CAACC,IAAI,CAACN,YAAY,CAAC,GAAGA,YAC9D,CAAC;UACH,CAAC,MAAM;YACL,MAAMO,WAAW,GAAG,IAAAC,mBAAU,EAACV,OAAO,CAACK,IAAI,EAAEH,YAAY,CAAC;YAE1D,MAAMS,cAAc,GAClBZ,IAAI,KAAK,oBAAoB,GAAGH,MAAM,CAACU,iBAAiB,GAAGV,MAAM,CAACgB,mBAAmB;YAEvFD,cAAc,CACZX,OAAO,CAACK,IAAI,EACZN,IAAI,KAAK,oBAAoB,GACzB,OAAOU,WAAW,KAAK,QAAQ,GAC7BF,MAAM,CAACC,IAAI,CAACC,WAAW,CAAC,GACxBI,SAAS,GACXJ,WACN,CAAC;UACH;QACF;QACA;;MAEF;MACA,KAAK,wBAAwB;QAC3BZ,oBAAoB,CAACiB,gBAAgB,CAACd,OAAO,CAACe,KAAK,CAAC;QACpDlB,oBAAoB,CAACmB,iBAAiB,CAAC,CAAC;QACxC;;MAEF;MACA,KAAK,uBAAuB;QAC1Bf,UAAU,CAACgB,QAAQ,CAACjB,OAAO,CAACkB,MAAM,CAAC;QACnC;;MAEF;MACA,KAAK,sBAAsB;QAAE;UAC3B;UACA,IAAIC,aAAa,GAAGlB,UAAU,CAACG,QAAQ,CAAC,CAAC;UAEzC,IAAIX,YAAY,CAAC2B,QAAQ,EAAE;YACzBD,aAAa,GAAG1B,YAAY,CAAC2B,QAAQ,CAACD,aAAa,CAAC;UACtD;UAEAvB,MAAM,CAACyB,IAAI,CAAC,uBAAuB,EAAE;YAAEC,KAAK,EAAEH;UAAc,CAAC,CAAC;UAC9D;QACF;;MAEA;MACA,KAAK,uBAAuB;QAAE;UAC5B;UACA,IAAII,aAAa,GAAGvB,OAAO,CAACsB,KAAK;UAEjC,IAAI7B,YAAY,CAAC+B,SAAS,EAAE;YAC1BD,aAAa,GAAG9B,YAAY,CAAC+B,SAAS,CAACxB,OAAO,CAACsB,KAAK,EAAErB,UAAU,CAACG,QAAQ,CAAC,CAAC,CAAC;UAC9E;;UAEA;UACA;UACAR,MAAM,CAACK,UAAU,CAACgB,QAAQ,CAAC;YACzBlB,IAAI,EAAEN,YAAY,CAACgC,iBAAiB;YACpCH,KAAK,EAAEC;UACT,CAAC,CAAC;UAEF;QACF;IACF;EACF,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = createCustomDispatch; | ||
| var _microdiff = _interopRequireDefault(require("microdiff")); | ||
| function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | ||
| function createCustomDispatch(reactotron, | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| store, pluginConfig) { | ||
| const exceptions = [pluginConfig.restoreActionType, ...(pluginConfig.except || [])]; | ||
| return action => { | ||
| // start a timer | ||
| const elapsed = reactotron.startTimer(); | ||
| // save the state before the action is dispatched to be used on "diff" | ||
| const oldState = store?.getState?.(); | ||
| // call the original dispatch that actually does the real work | ||
| const result = store.dispatch(action); | ||
| // stop the timer | ||
| const ms = elapsed(); | ||
| const unwrappedAction = action.type === "PERFORM_ACTION" && action.action ? action.action : action; | ||
| const isException = exceptions.some(exception => { | ||
| if (typeof exception === "string") { | ||
| return unwrappedAction.type === exception; | ||
| } else if (typeof exception === "function") { | ||
| return exception(unwrappedAction.type); | ||
| } else if (exception instanceof RegExp) { | ||
| return exception.test(unwrappedAction.type); | ||
| } else { | ||
| return false; | ||
| } | ||
| }); | ||
| // action not blacklisted? | ||
| // if matchException is true, action.type is matched with exception | ||
| if (!isException) { | ||
| // check if the app considers this important | ||
| let important = false; | ||
| if (pluginConfig && typeof pluginConfig.isActionImportant === "function") { | ||
| important = !!pluginConfig.isActionImportant(unwrappedAction); | ||
| } | ||
| const state = store?.getState?.(); | ||
| reactotron.reportReduxAction(unwrappedAction, ms, important, (0, _microdiff.default)(oldState, state)); | ||
| } | ||
| return result; | ||
| }; | ||
| } | ||
| //# sourceMappingURL=customDispatch.js.map |
| {"version":3,"names":["_microdiff","_interopRequireDefault","require","e","__esModule","default","createCustomDispatch","reactotron","store","pluginConfig","exceptions","restoreActionType","except","action","elapsed","startTimer","oldState","getState","result","dispatch","ms","unwrappedAction","type","isException","some","exception","RegExp","test","important","isActionImportant","state","reportReduxAction","diff"],"sourceRoot":"../../src","sources":["customDispatch.ts"],"mappings":";;;;;;AAAA,IAAAA,UAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA4B,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAIb,SAASG,oBAAoBA,CAC1CC,UAAe;AACf;AACAC,KAAkD,EAClDC,YAA0B,EAC1B;EACA,MAAMC,UAAU,GAAG,CAACD,YAAY,CAACE,iBAAiB,EAAE,IAAIF,YAAY,CAACG,MAAM,IAAI,EAAE,CAAC,CAAC;EAEnF,OAAQC,MAAW,IAAK;IACtB;IACA,MAAMC,OAAO,GAAGP,UAAU,CAACQ,UAAU,CAAC,CAAC;;IAEvC;IACA,MAAMC,QAAQ,GAAGR,KAAK,EAAES,QAAQ,GAAG,CAAC;;IAEpC;IACA,MAAMC,MAAM,GAAGV,KAAK,CAACW,QAAQ,CAACN,MAAM,CAAC;;IAErC;IACA,MAAMO,EAAE,GAAGN,OAAO,CAAC,CAAC;IAEpB,MAAMO,eAAe,GACnBR,MAAM,CAACS,IAAI,KAAK,gBAAgB,IAAIT,MAAM,CAACA,MAAM,GAAGA,MAAM,CAACA,MAAM,GAAGA,MAAM;IAE5E,MAAMU,WAAW,GAAGb,UAAU,CAACc,IAAI,CAAEC,SAAS,IAAK;MACjD,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;QACjC,OAAOJ,eAAe,CAACC,IAAI,KAAKG,SAAS;MAC3C,CAAC,MAAM,IAAI,OAAOA,SAAS,KAAK,UAAU,EAAE;QAC1C,OAAOA,SAAS,CAACJ,eAAe,CAACC,IAAI,CAAC;MACxC,CAAC,MAAM,IAAIG,SAAS,YAAYC,MAAM,EAAE;QACtC,OAAOD,SAAS,CAACE,IAAI,CAACN,eAAe,CAACC,IAAI,CAAC;MAC7C,CAAC,MAAM;QACL,OAAO,KAAK;MACd;IACF,CAAC,CAAC;;IAEF;IACA;IACA,IAAI,CAACC,WAAW,EAAE;MAChB;MACA,IAAIK,SAAS,GAAG,KAAK;MACrB,IAAInB,YAAY,IAAI,OAAOA,YAAY,CAACoB,iBAAiB,KAAK,UAAU,EAAE;QACxED,SAAS,GAAG,CAAC,CAACnB,YAAY,CAACoB,iBAAiB,CAACR,eAAe,CAAC;MAC/D;MACA,MAAMS,KAAK,GAAGtB,KAAK,EAAES,QAAQ,GAAG,CAAC;MACjCV,UAAU,CAACwB,iBAAiB,CAACV,eAAe,EAAED,EAAE,EAAEQ,SAAS,EAAE,IAAAI,kBAAI,EAAChB,QAAQ,EAAEc,KAAK,CAAC,CAAC;IACrF;IAEA,OAAOZ,MAAM;EACf,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = createEnhancer; | ||
| var _reducer = _interopRequireDefault(require("./reducer")); | ||
| var _customDispatch = _interopRequireDefault(require("./customDispatch")); | ||
| function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | ||
| function createEnhancer(reactotron, pluginConfig, handleStoreCreation) { | ||
| return (skipSettingStore = false) => createStore => (reducer, ...args) => { | ||
| const originalStore = createStore((0, _reducer.default)(reducer, pluginConfig.restoreActionType), ...args); | ||
| const store = { | ||
| ...originalStore, | ||
| dispatch: (0, _customDispatch.default)(reactotron, originalStore, pluginConfig) | ||
| }; | ||
| if (!skipSettingStore) { | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| reactotron.reduxStore = store; | ||
| handleStoreCreation(); | ||
| } | ||
| return store; | ||
| }; | ||
| } | ||
| //# sourceMappingURL=enhancer.js.map |
| {"version":3,"names":["_reducer","_interopRequireDefault","require","_customDispatch","e","__esModule","default","createEnhancer","reactotron","pluginConfig","handleStoreCreation","skipSettingStore","createStore","reducer","args","originalStore","reactotronReducer","restoreActionType","store","dispatch","createCustomDispatch","reduxStore"],"sourceRoot":"../../src","sources":["enhancer.ts"],"mappings":";;;;;;AAEA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAF,sBAAA,CAAAC,OAAA;AAAmD,SAAAD,uBAAAG,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGpC,SAASG,cAAcA,CACpCC,UAAkB,EAClBC,YAA0B,EAC1BC,mBAA+B,EAC/B;EACA,OAAO,CAACC,gBAAgB,GAAG,KAAK,KAC7BC,WAAW,IACZ,CAACC,OAAO,EAAE,GAAGC,IAAI,KAAK;IACpB,MAAMC,aAAa,GAAGH,WAAW,CAC/B,IAAAI,gBAAiB,EAACH,OAAO,EAAEJ,YAAY,CAACQ,iBAAiB,CAAC,EAC1D,GAAGH,IACL,CAAC;IACD,MAAMI,KAAK,GAAG;MACZ,GAAGH,aAAa;MAChBI,QAAQ,EAAE,IAAAC,uBAAoB,EAACZ,UAAU,EAAEO,aAAa,EAAEN,YAAY;IACxE,CAAC;IAED,IAAI,CAACE,gBAAgB,EAAE;MACrB;MACA;MACAH,UAAU,CAACa,UAAU,GAAGH,KAAK;MAC7BR,mBAAmB,CAAC,CAAC;IACvB;IAEA,OAAOQ,KAAK;EACd,CAAC;AACL","ignoreList":[]} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = pathObject; | ||
| function pathObject(path, obj) { | ||
| if (!path) return obj; | ||
| const splitPaths = path.split("."); | ||
| let pathedObj = obj; | ||
| for (let i = 0; i < splitPaths.length; i++) { | ||
| const curPath = splitPaths[i]; | ||
| pathedObj = pathedObj[curPath]; | ||
| if (i < splitPaths.length - 1 && typeof pathedObj !== "object") { | ||
| pathedObj = undefined; | ||
| break; | ||
| } | ||
| } | ||
| return pathedObj; | ||
| } | ||
| //# sourceMappingURL=pathObject.js.map |
| {"version":3,"names":["pathObject","path","obj","splitPaths","split","pathedObj","i","length","curPath","undefined"],"sourceRoot":"../../../src","sources":["helpers/pathObject.ts"],"mappings":";;;;;;AAAe,SAASA,UAAUA,CAACC,IAAY,EAAEC,GAAQ,EAAE;EACzD,IAAI,CAACD,IAAI,EAAE,OAAOC,GAAG;EAErB,MAAMC,UAAU,GAAGF,IAAI,CAACG,KAAK,CAAC,GAAG,CAAC;EAElC,IAAIC,SAAS,GAAGH,GAAG;EAEnB,KAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,UAAU,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;IAC1C,MAAME,OAAO,GAAGL,UAAU,CAACG,CAAC,CAAC;IAC7BD,SAAS,GAAGA,SAAS,CAACG,OAAO,CAAC;IAE9B,IAAIF,CAAC,GAAGH,UAAU,CAACI,MAAM,GAAG,CAAC,IAAI,OAAOF,SAAS,KAAK,QAAQ,EAAE;MAC9DA,SAAS,GAAGI,SAAS;MACrB;IACF;EACF;EAEA,OAAOJ,SAAS;AAClB","ignoreList":[]} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = void 0; | ||
| var _default = state => { | ||
| // If we have a toJS, lets assume we need to call it to get a plan 'ol JS object | ||
| // NOTE: This handles ImmutableJS | ||
| if (state.toJS) { | ||
| return state.toJS(); | ||
| } | ||
| return state; | ||
| }; | ||
| exports.default = _default; | ||
| //# sourceMappingURL=stateCleaner.js.map |
| {"version":3,"names":["state","toJS","exports","default","_default"],"sourceRoot":"../../../src","sources":["helpers/stateCleaner.ts"],"mappings":";;;;;;eAAgBA,KAAU,IAAK;EAC7B;EACA;EACA,IAAIA,KAAK,CAACC,IAAI,EAAE;IACd,OAAOD,KAAK,CAACC,IAAI,CAAC,CAAC;EACrB;EAEA,OAAOD,KAAK;AACd,CAAC;AAAAE,OAAA,CAAAC,OAAA,GAAAC,QAAA","ignoreList":[]} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.reactotronRedux = reactotronRedux; | ||
| var _commandHandler = _interopRequireDefault(require("./commandHandler")); | ||
| var _sendAction = _interopRequireDefault(require("./sendAction")); | ||
| var _enhancer = _interopRequireDefault(require("./enhancer")); | ||
| var _reducer = require("./reducer"); | ||
| function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | ||
| function reactotronRedux(pluginConfig = {}) { | ||
| const mergedPluginConfig = { | ||
| ...pluginConfig, | ||
| restoreActionType: pluginConfig.restoreActionType || _reducer.DEFAULT_REPLACER_TYPE | ||
| }; | ||
| const storeCreationHandlers = []; | ||
| const onReduxStoreCreation = func => { | ||
| storeCreationHandlers.push(func); | ||
| }; | ||
| const handleStoreCreation = () => { | ||
| storeCreationHandlers.forEach(func => { | ||
| func(); | ||
| }); | ||
| }; | ||
| function plugin(reactotron) { | ||
| return { | ||
| // Fires when we receive a command from the Reactotron app. | ||
| onCommand: (0, _commandHandler.default)(reactotron, mergedPluginConfig, onReduxStoreCreation), | ||
| // All keys in this object will be attached to the main Reactotron instance | ||
| // and available to be called directly. | ||
| features: { | ||
| createEnhancer: (0, _enhancer.default)(reactotron, mergedPluginConfig, handleStoreCreation), | ||
| setReduxStore: store => { | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| reactotron.reduxStore = store; | ||
| handleStoreCreation(); | ||
| }, | ||
| reportReduxAction: (0, _sendAction.default)(reactotron) | ||
| } | ||
| }; | ||
| } | ||
| return plugin; | ||
| } | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"names":["_commandHandler","_interopRequireDefault","require","_sendAction","_enhancer","_reducer","e","__esModule","default","reactotronRedux","pluginConfig","mergedPluginConfig","restoreActionType","DEFAULT_REPLACER_TYPE","storeCreationHandlers","onReduxStoreCreation","func","push","handleStoreCreation","forEach","plugin","reactotron","onCommand","createCommandHander","features","createEnhancer","setReduxStore","store","reduxStore","reportReduxAction","createSendAction"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;AAEA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,SAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAAiD,SAAAD,uBAAAK,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAGjD,SAASG,eAAeA,CAACC,YAA0B,GAAG,CAAC,CAAC,EAAE;EACxD,MAAMC,kBAAgC,GAAG;IACvC,GAAGD,YAAY;IACfE,iBAAiB,EAAEF,YAAY,CAACE,iBAAiB,IAAIC;EACvD,CAAC;EAED,MAAMC,qBAAqC,GAAG,EAAE;EAChD,MAAMC,oBAAoB,GAAIC,IAAgB,IAAK;IACjDF,qBAAqB,CAACG,IAAI,CAACD,IAAI,CAAC;EAClC,CAAC;EACD,MAAME,mBAAmB,GAAGA,CAAA,KAAM;IAChCJ,qBAAqB,CAACK,OAAO,CAAEH,IAAI,IAAK;MACtCA,IAAI,CAAC,CAAC;IACR,CAAC,CAAC;EACJ,CAAC;EAED,SAASI,MAAMA,CAAiDC,UAAkB,EAAE;IAClF,OAAO;MACL;MACAC,SAAS,EAAE,IAAAC,uBAAmB,EAACF,UAAU,EAAEV,kBAAkB,EAAEI,oBAAoB,CAAC;MAEpF;MACA;MACAS,QAAQ,EAAE;QACRC,cAAc,EAAE,IAAAA,iBAAc,EAACJ,UAAU,EAAEV,kBAAkB,EAAEO,mBAAmB,CAAC;QACnFQ,aAAa,EAAGC,KAAK,IAAK;UACxB;UACA;UACAN,UAAU,CAACO,UAAU,GAAGD,KAAK;UAC7BT,mBAAmB,CAAC,CAAC;QACvB,CAAC;QACDW,iBAAiB,EAAE,IAAAC,mBAAgB,EAACT,UAAU;MAChD;IACF,CAAC;EACH;EAEA,OAAOD,MAAM;AACf","ignoreList":[]} |
| {"type":"commonjs"} |
| "use strict"; | ||
| //# sourceMappingURL=pluginConfig.js.map |
| {"version":3,"names":[],"sourceRoot":"../../src","sources":["pluginConfig.ts"],"mappings":"","ignoreList":[]} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.DEFAULT_REPLACER_TYPE = void 0; | ||
| exports.default = reactotronReducer; | ||
| const DEFAULT_REPLACER_TYPE = exports.DEFAULT_REPLACER_TYPE = "REACTOTRON_RESTORE_STATE"; | ||
| function reactotronReducer( | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| rootReducer, actionName = DEFAULT_REPLACER_TYPE) { | ||
| // return this reducer | ||
| return (state, action) => { | ||
| // is this action the one we're waiting for? if so, use the state it passed | ||
| const whichState = action.type === actionName ? action.state : state; | ||
| return rootReducer(whichState, action); | ||
| }; | ||
| } | ||
| //# sourceMappingURL=reducer.js.map |
| {"version":3,"names":["DEFAULT_REPLACER_TYPE","exports","reactotronReducer","rootReducer","actionName","state","action","whichState","type"],"sourceRoot":"../../src","sources":["reducer.ts"],"mappings":";;;;;;;AAAO,MAAMA,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,GAAG,0BAA0B;AAEhD,SAASE,iBAAiBA;AACvC;AACAC,WAAqB,EACrBC,UAAU,GAAGJ,qBAAqB,EAClC;EACA;EACA,OAAO,CAACK,KAAU,EAAEC,MAAqC,KAAK;IAC5D;IACA,MAAMC,UAAU,GAAGD,MAAM,CAACE,IAAI,KAAKJ,UAAU,GAAGE,MAAM,CAACD,KAAK,GAAGA,KAAK;IACpE,OAAOF,WAAW,CAACI,UAAU,EAAED,MAAM,CAAC;EACxC,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = createSendAction; | ||
| function createSendAction(reactotron) { | ||
| return (action, ms, important = false, diff) => { | ||
| // let's call the type, name because that's "generic" name in Reactotron | ||
| let { | ||
| type: name | ||
| } = action; | ||
| // convert from symbol to type if necessary | ||
| if (typeof name === "symbol") { | ||
| name = name.toString().replace(/^Symbol\(/, "").replace(/\)$/, ""); | ||
| } | ||
| // off ya go! | ||
| reactotron.send("state.action.complete", { | ||
| name, | ||
| action, | ||
| ms, | ||
| diff | ||
| }, important); | ||
| }; | ||
| } | ||
| //# sourceMappingURL=sendAction.js.map |
| {"version":3,"names":["createSendAction","reactotron","action","ms","important","diff","type","name","toString","replace","send"],"sourceRoot":"../../src","sources":["sendAction.ts"],"mappings":";;;;;;AAEe,SAASA,gBAAgBA,CACtCC,UAAkB,EAClB;EACA,OAAO,CAACC,MAAqB,EAAEC,EAAU,EAAEC,SAAS,GAAG,KAAK,EAAEC,IAAU,KAAK;IAC3E;IACA,IAAI;MAAEC,IAAI,EAAEC;IAAK,CAAC,GAAGL,MAAM;;IAE3B;IACA,IAAI,OAAOK,IAAI,KAAK,QAAQ,EAAE;MAC5BA,IAAI,GAAGA,IAAI,CACRC,QAAQ,CAAC,CAAC,CACVC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CACxBA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IACvB;;IAEA;IACAR,UAAU,CAACS,IAAI,CAAC,uBAAuB,EAAE;MAAEH,IAAI;MAAEL,MAAM;MAAEC,EAAE;MAAEE;IAAK,CAAC,EAAED,SAAS,CAAC;EACjF,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.default = createSubscriptionHandler; | ||
| var _pathObject = _interopRequireDefault(require("./helpers/pathObject")); | ||
| function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; } | ||
| function createSubscriptionHandler(reactotron, onReduxStoreCreation) { | ||
| let subscriptions = []; | ||
| function setSubscriptions(subs) { | ||
| subscriptions = subs; | ||
| } | ||
| function getChanges() { | ||
| // If we don't have reactotron, dont have a store or getState isn't a function then get out. Now. | ||
| if (!reactotron || !reactotron.reduxStore || typeof reactotron.reduxStore.getState !== "function") { | ||
| return []; | ||
| } | ||
| const state = reactotron.reduxStore.getState(); | ||
| const changes = []; | ||
| subscriptions.forEach(path => { | ||
| let cleanedPath = path; | ||
| let starredPath = false; | ||
| if (path && path.endsWith("*")) { | ||
| // Handle the star! | ||
| starredPath = true; | ||
| cleanedPath = path.substr(0, path.length - 2); | ||
| } | ||
| const values = (0, _pathObject.default)(cleanedPath, state); | ||
| if (starredPath && cleanedPath && values) { | ||
| changes.push(...Object.entries(values).map(val => ({ | ||
| path: `${cleanedPath}.${val[0]}`, | ||
| value: val[1] | ||
| }))); | ||
| } else { | ||
| changes.push({ | ||
| path: cleanedPath, | ||
| value: values | ||
| }); | ||
| } | ||
| }); | ||
| return changes; | ||
| } | ||
| function sendSubscriptions() { | ||
| const changes = getChanges(); | ||
| reactotron.stateValuesChange(changes); | ||
| } | ||
| function sendSubscriptionsIfNeeded() { | ||
| const changes = getChanges(); | ||
| if (changes.length > 0) { | ||
| reactotron.stateValuesChange(changes); | ||
| } | ||
| } | ||
| onReduxStoreCreation(() => { | ||
| reactotron.reduxStore.subscribe(sendSubscriptionsIfNeeded); | ||
| }); | ||
| return { | ||
| sendSubscriptions, | ||
| sendSubscriptionsIfNeeded, | ||
| setSubscriptions | ||
| }; | ||
| } | ||
| //# sourceMappingURL=subscriptionsHandler.js.map |
| {"version":3,"names":["_pathObject","_interopRequireDefault","require","e","__esModule","default","createSubscriptionHandler","reactotron","onReduxStoreCreation","subscriptions","setSubscriptions","subs","getChanges","reduxStore","getState","state","changes","forEach","path","cleanedPath","starredPath","endsWith","substr","length","values","pathObject","push","Object","entries","map","val","value","sendSubscriptions","stateValuesChange","sendSubscriptionsIfNeeded","subscribe"],"sourceRoot":"../../src","sources":["subscriptionsHandler.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA6C,SAAAD,uBAAAE,CAAA,WAAAA,CAAA,IAAAA,CAAA,CAAAC,UAAA,GAAAD,CAAA,KAAAE,OAAA,EAAAF,CAAA;AAE9B,SAASG,yBAAyBA,CAC/CC,UAAe,EACfC,oBAAgD,EAChD;EACA,IAAIC,aAAuB,GAAG,EAAE;EAEhC,SAASC,gBAAgBA,CAACC,IAAc,EAAE;IACxCF,aAAa,GAAGE,IAAI;EACtB;EAEA,SAASC,UAAUA,CAAA,EAAG;IACpB;IACA,IACE,CAACL,UAAU,IACX,CAACA,UAAU,CAACM,UAAU,IACtB,OAAON,UAAU,CAACM,UAAU,CAACC,QAAQ,KAAK,UAAU,EACpD;MACA,OAAO,EAAE;IACX;IAEA,MAAMC,KAAK,GAAGR,UAAU,CAACM,UAAU,CAACC,QAAQ,CAAC,CAAC;IAE9C,MAAME,OAAO,GAAG,EAAE;IAElBP,aAAa,CAACQ,OAAO,CAAEC,IAAI,IAAK;MAC9B,IAAIC,WAAW,GAAGD,IAAI;MACtB,IAAIE,WAAW,GAAG,KAAK;MAEvB,IAAIF,IAAI,IAAIA,IAAI,CAACG,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC9B;QACAD,WAAW,GAAG,IAAI;QAClBD,WAAW,GAAGD,IAAI,CAACI,MAAM,CAAC,CAAC,EAAEJ,IAAI,CAACK,MAAM,GAAG,CAAC,CAAC;MAC/C;MAEA,MAAMC,MAAM,GAAG,IAAAC,mBAAU,EAACN,WAAW,EAAEJ,KAAK,CAAC;MAE7C,IAAIK,WAAW,IAAID,WAAW,IAAIK,MAAM,EAAE;QACxCR,OAAO,CAACU,IAAI,CACV,GAAGC,MAAM,CAACC,OAAO,CAACJ,MAAM,CAAC,CAACK,GAAG,CAAEC,GAAG,KAAM;UACtCZ,IAAI,EAAE,GAAGC,WAAW,IAAIW,GAAG,CAAC,CAAC,CAAC,EAAE;UAChCC,KAAK,EAAED,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CACJ,CAAC;MACH,CAAC,MAAM;QACLd,OAAO,CAACU,IAAI,CAAC;UAAER,IAAI,EAAEC,WAAW;UAAEY,KAAK,EAAEP;QAAO,CAAC,CAAC;MACpD;IACF,CAAC,CAAC;IAEF,OAAOR,OAAO;EAChB;EAEA,SAASgB,iBAAiBA,CAAA,EAAG;IAC3B,MAAMhB,OAAO,GAAGJ,UAAU,CAAC,CAAC;IAC5BL,UAAU,CAAC0B,iBAAiB,CAACjB,OAAO,CAAC;EACvC;EAEA,SAASkB,yBAAyBA,CAAA,EAAG;IACnC,MAAMlB,OAAO,GAAGJ,UAAU,CAAC,CAAC;IAE5B,IAAII,OAAO,CAACO,MAAM,GAAG,CAAC,EAAE;MACtBhB,UAAU,CAAC0B,iBAAiB,CAACjB,OAAO,CAAC;IACvC;EACF;EAEAR,oBAAoB,CAAC,MAAM;IACzBD,UAAU,CAACM,UAAU,CAACsB,SAAS,CAACD,yBAAyB,CAAC;EAC5D,CAAC,CAAC;EAEF,OAAO;IACLF,iBAAiB;IACjBE,yBAAyB;IACzBxB;EACF,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true | ||
| }); | ||
| exports.defaultReactotronMock = void 0; | ||
| const defaultReactotronMock = exports.defaultReactotronMock = { | ||
| startTimer: jest.fn(), | ||
| configure: jest.fn(), | ||
| close: jest.fn(), | ||
| connect: jest.fn(), | ||
| send: jest.fn(), | ||
| display: jest.fn(), | ||
| use: jest.fn(), | ||
| onCustomCommand: jest.fn(), | ||
| clear: jest.fn(), | ||
| apiResponse: jest.fn(), | ||
| benchmark: jest.fn(), | ||
| debug: jest.fn(), | ||
| error: jest.fn(), | ||
| image: jest.fn(), | ||
| log: jest.fn(), | ||
| logImportant: jest.fn(), | ||
| plugins: [], | ||
| options: {}, | ||
| repl: jest.fn(), | ||
| stateActionComplete: jest.fn(), | ||
| stateBackupResponse: jest.fn(), | ||
| stateKeysResponse: jest.fn(), | ||
| stateValuesChange: jest.fn(), | ||
| stateValuesResponse: jest.fn(), | ||
| warn: jest.fn(), | ||
| createEnhancer: jest.fn(), | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| reduxStore: jest.fn(), | ||
| setReduxStore: jest.fn() | ||
| }; | ||
| //# sourceMappingURL=testHelpers.js.map |
| {"version":3,"names":["defaultReactotronMock","exports","startTimer","jest","fn","configure","close","connect","send","display","use","onCustomCommand","clear","apiResponse","benchmark","debug","error","image","log","logImportant","plugins","options","repl","stateActionComplete","stateBackupResponse","stateKeysResponse","stateValuesChange","stateValuesResponse","warn","createEnhancer","reduxStore","setReduxStore"],"sourceRoot":"../../src","sources":["testHelpers.ts"],"mappings":";;;;;;AAGO,MAAMA,qBAAoF,GAAAC,OAAA,CAAAD,qBAAA,GAC/F;EACEE,UAAU,EAAEC,IAAI,CAACC,EAAE,CAAC,CAAC;EACrBC,SAAS,EAAEF,IAAI,CAACC,EAAE,CAAC,CAAC;EACpBE,KAAK,EAAEH,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBG,OAAO,EAAEJ,IAAI,CAACC,EAAE,CAAC,CAAC;EAClBI,IAAI,EAAEL,IAAI,CAACC,EAAE,CAAC,CAAC;EACfK,OAAO,EAAEN,IAAI,CAACC,EAAE,CAAC,CAAC;EAClBM,GAAG,EAAEP,IAAI,CAACC,EAAE,CAAC,CAAC;EACdO,eAAe,EAAER,IAAI,CAACC,EAAE,CAAC,CAAC;EAC1BQ,KAAK,EAAET,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBS,WAAW,EAAEV,IAAI,CAACC,EAAE,CAAC,CAAC;EACtBU,SAAS,EAAEX,IAAI,CAACC,EAAE,CAAC,CAAC;EACpBW,KAAK,EAAEZ,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBY,KAAK,EAAEb,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBa,KAAK,EAAEd,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBc,GAAG,EAAEf,IAAI,CAACC,EAAE,CAAC,CAAC;EACde,YAAY,EAAEhB,IAAI,CAACC,EAAE,CAAC,CAAC;EACvBgB,OAAO,EAAE,EAAE;EACXC,OAAO,EAAE,CAAC,CAAC;EACXC,IAAI,EAAEnB,IAAI,CAACC,EAAE,CAAC,CAAC;EACfmB,mBAAmB,EAAEpB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC9BoB,mBAAmB,EAAErB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC9BqB,iBAAiB,EAAEtB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC5BsB,iBAAiB,EAAEvB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC5BuB,mBAAmB,EAAExB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC9BwB,IAAI,EAAEzB,IAAI,CAACC,EAAE,CAAC,CAAC;EACfyB,cAAc,EAAE1B,IAAI,CAACC,EAAE,CAAC,CAAC;EACzB;EACA;EACA0B,UAAU,EAAE3B,IAAI,CAACC,EAAE,CAAC,CAAC;EACrB2B,aAAa,EAAE5B,IAAI,CAACC,EAAE,CAAC;AACzB,CAAC","ignoreList":[]} |
| "use strict"; | ||
| import { assertHasStateResponsePlugin } from "reactotron-core-client"; | ||
| import stateCleaner from "./helpers/stateCleaner.js"; | ||
| import pathObject from "./helpers/pathObject.js"; | ||
| import createSubscriptionsHandler from "./subscriptionsHandler.js"; | ||
| export default function createCommandHandler(reactotron, pluginConfig, onReduxStoreCreation) { | ||
| // make sure have loaded the StateResponsePlugin | ||
| assertHasStateResponsePlugin(reactotron); | ||
| const client = reactotron; | ||
| // create our subscriptions handler | ||
| const subscriptionsHandler = createSubscriptionsHandler(reactotron, onReduxStoreCreation); | ||
| return ({ | ||
| type, | ||
| payload | ||
| }) => { | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| const reduxStore = client.reduxStore; | ||
| switch (type) { | ||
| // client is asking for keys | ||
| case "state.keys.request": | ||
| case "state.values.request": | ||
| { | ||
| const cleanedState = stateCleaner(reduxStore.getState()); | ||
| if (!payload.path) { | ||
| client.stateKeysResponse(null, type === "state.keys.request" ? Object.keys(cleanedState) : cleanedState); | ||
| } else { | ||
| const filteredObj = pathObject(payload.path, cleanedState); | ||
| const responseMethod = type === "state.keys.request" ? client.stateKeysResponse : client.stateValuesResponse; | ||
| responseMethod(payload.path, type === "state.keys.request" ? typeof filteredObj === "object" ? Object.keys(filteredObj) : undefined : filteredObj); | ||
| } | ||
| } | ||
| break; | ||
| // client is asking to subscribe to some paths | ||
| case "state.values.subscribe": | ||
| subscriptionsHandler.setSubscriptions(payload.paths); | ||
| subscriptionsHandler.sendSubscriptions(); | ||
| break; | ||
| // server is asking to dispatch this action | ||
| case "state.action.dispatch": | ||
| reduxStore.dispatch(payload.action); | ||
| break; | ||
| // server is asking to backup state | ||
| case "state.backup.request": | ||
| { | ||
| // run our state through our onBackup | ||
| let backedUpState = reduxStore.getState(); | ||
| if (pluginConfig.onBackup) { | ||
| backedUpState = pluginConfig.onBackup(backedUpState); | ||
| } | ||
| client.send("state.backup.response", { | ||
| state: backedUpState | ||
| }); | ||
| break; | ||
| } | ||
| // server is asking to clobber state with this | ||
| case "state.restore.request": | ||
| { | ||
| // run our state through our onRestore | ||
| let restoredState = payload.state; | ||
| if (pluginConfig.onRestore) { | ||
| restoredState = pluginConfig.onRestore(payload.state, reduxStore.getState()); | ||
| } | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| client.reduxStore.dispatch({ | ||
| type: pluginConfig.restoreActionType, | ||
| state: restoredState | ||
| }); | ||
| break; | ||
| } | ||
| } | ||
| }; | ||
| } | ||
| //# sourceMappingURL=commandHandler.js.map |
| {"version":3,"names":["assertHasStateResponsePlugin","stateCleaner","pathObject","createSubscriptionsHandler","createCommandHandler","reactotron","pluginConfig","onReduxStoreCreation","client","subscriptionsHandler","type","payload","reduxStore","cleanedState","getState","path","stateKeysResponse","Object","keys","filteredObj","responseMethod","stateValuesResponse","undefined","setSubscriptions","paths","sendSubscriptions","dispatch","action","backedUpState","onBackup","send","state","restoredState","onRestore","restoreActionType"],"sourceRoot":"../../src","sources":["commandHandler.ts"],"mappings":";;AAAA,SAIEA,4BAA4B,QACvB,wBAAwB;AAE/B,OAAOC,YAAY,MAAM,2BAAwB;AACjD,OAAOC,UAAU,MAAM,yBAAsB;AAC7C,OAAOC,0BAA0B,MAAM,2BAAwB;AAG/D,eAAe,SAASC,oBAAoBA,CAC1CC,UAAkB,EAClBC,YAA0B,EAC1BC,oBAAgD,EAChD;EACA;EACAP,4BAA4B,CAACK,UAAU,CAAC;EACxC,MAAMG,MAAM,GAAGH,UAAiE;;EAEhF;EACA,MAAMI,oBAAoB,GAAGN,0BAA0B,CAACE,UAAU,EAAEE,oBAAoB,CAAC;EAEzF,OAAO,CAAC;IAAEG,IAAI;IAAEC;EAAyC,CAAC,KAAK;IAC7D;IACA;IACA,MAAMC,UAAU,GAAGJ,MAAM,CAACI,UAAU;IAEpC,QAAQF,IAAI;MACV;MACA,KAAK,oBAAoB;MACzB,KAAK,sBAAsB;QACzB;UACE,MAAMG,YAAY,GAAGZ,YAAY,CAACW,UAAU,CAACE,QAAQ,CAAC,CAAC,CAAC;UAExD,IAAI,CAACH,OAAO,CAACI,IAAI,EAAE;YACjBP,MAAM,CAACQ,iBAAiB,CACtB,IAAI,EACJN,IAAI,KAAK,oBAAoB,GAAGO,MAAM,CAACC,IAAI,CAACL,YAAY,CAAC,GAAGA,YAC9D,CAAC;UACH,CAAC,MAAM;YACL,MAAMM,WAAW,GAAGjB,UAAU,CAACS,OAAO,CAACI,IAAI,EAAEF,YAAY,CAAC;YAE1D,MAAMO,cAAc,GAClBV,IAAI,KAAK,oBAAoB,GAAGF,MAAM,CAACQ,iBAAiB,GAAGR,MAAM,CAACa,mBAAmB;YAEvFD,cAAc,CACZT,OAAO,CAACI,IAAI,EACZL,IAAI,KAAK,oBAAoB,GACzB,OAAOS,WAAW,KAAK,QAAQ,GAC7BF,MAAM,CAACC,IAAI,CAACC,WAAW,CAAC,GACxBG,SAAS,GACXH,WACN,CAAC;UACH;QACF;QACA;;MAEF;MACA,KAAK,wBAAwB;QAC3BV,oBAAoB,CAACc,gBAAgB,CAACZ,OAAO,CAACa,KAAK,CAAC;QACpDf,oBAAoB,CAACgB,iBAAiB,CAAC,CAAC;QACxC;;MAEF;MACA,KAAK,uBAAuB;QAC1Bb,UAAU,CAACc,QAAQ,CAACf,OAAO,CAACgB,MAAM,CAAC;QACnC;;MAEF;MACA,KAAK,sBAAsB;QAAE;UAC3B;UACA,IAAIC,aAAa,GAAGhB,UAAU,CAACE,QAAQ,CAAC,CAAC;UAEzC,IAAIR,YAAY,CAACuB,QAAQ,EAAE;YACzBD,aAAa,GAAGtB,YAAY,CAACuB,QAAQ,CAACD,aAAa,CAAC;UACtD;UAEApB,MAAM,CAACsB,IAAI,CAAC,uBAAuB,EAAE;YAAEC,KAAK,EAAEH;UAAc,CAAC,CAAC;UAC9D;QACF;;MAEA;MACA,KAAK,uBAAuB;QAAE;UAC5B;UACA,IAAII,aAAa,GAAGrB,OAAO,CAACoB,KAAK;UAEjC,IAAIzB,YAAY,CAAC2B,SAAS,EAAE;YAC1BD,aAAa,GAAG1B,YAAY,CAAC2B,SAAS,CAACtB,OAAO,CAACoB,KAAK,EAAEnB,UAAU,CAACE,QAAQ,CAAC,CAAC,CAAC;UAC9E;;UAEA;UACA;UACAN,MAAM,CAACI,UAAU,CAACc,QAAQ,CAAC;YACzBhB,IAAI,EAAEJ,YAAY,CAAC4B,iBAAiB;YACpCH,KAAK,EAAEC;UACT,CAAC,CAAC;UAEF;QACF;IACF;EACF,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| import diff from "microdiff"; | ||
| export default function createCustomDispatch(reactotron, | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| store, pluginConfig) { | ||
| const exceptions = [pluginConfig.restoreActionType, ...(pluginConfig.except || [])]; | ||
| return action => { | ||
| // start a timer | ||
| const elapsed = reactotron.startTimer(); | ||
| // save the state before the action is dispatched to be used on "diff" | ||
| const oldState = store?.getState?.(); | ||
| // call the original dispatch that actually does the real work | ||
| const result = store.dispatch(action); | ||
| // stop the timer | ||
| const ms = elapsed(); | ||
| const unwrappedAction = action.type === "PERFORM_ACTION" && action.action ? action.action : action; | ||
| const isException = exceptions.some(exception => { | ||
| if (typeof exception === "string") { | ||
| return unwrappedAction.type === exception; | ||
| } else if (typeof exception === "function") { | ||
| return exception(unwrappedAction.type); | ||
| } else if (exception instanceof RegExp) { | ||
| return exception.test(unwrappedAction.type); | ||
| } else { | ||
| return false; | ||
| } | ||
| }); | ||
| // action not blacklisted? | ||
| // if matchException is true, action.type is matched with exception | ||
| if (!isException) { | ||
| // check if the app considers this important | ||
| let important = false; | ||
| if (pluginConfig && typeof pluginConfig.isActionImportant === "function") { | ||
| important = !!pluginConfig.isActionImportant(unwrappedAction); | ||
| } | ||
| const state = store?.getState?.(); | ||
| reactotron.reportReduxAction(unwrappedAction, ms, important, diff(oldState, state)); | ||
| } | ||
| return result; | ||
| }; | ||
| } | ||
| //# sourceMappingURL=customDispatch.js.map |
| {"version":3,"names":["diff","createCustomDispatch","reactotron","store","pluginConfig","exceptions","restoreActionType","except","action","elapsed","startTimer","oldState","getState","result","dispatch","ms","unwrappedAction","type","isException","some","exception","RegExp","test","important","isActionImportant","state","reportReduxAction"],"sourceRoot":"../../src","sources":["customDispatch.ts"],"mappings":";;AAAA,OAAOA,IAAI,MAAM,WAAW;AAI5B,eAAe,SAASC,oBAAoBA,CAC1CC,UAAe;AACf;AACAC,KAAkD,EAClDC,YAA0B,EAC1B;EACA,MAAMC,UAAU,GAAG,CAACD,YAAY,CAACE,iBAAiB,EAAE,IAAIF,YAAY,CAACG,MAAM,IAAI,EAAE,CAAC,CAAC;EAEnF,OAAQC,MAAW,IAAK;IACtB;IACA,MAAMC,OAAO,GAAGP,UAAU,CAACQ,UAAU,CAAC,CAAC;;IAEvC;IACA,MAAMC,QAAQ,GAAGR,KAAK,EAAES,QAAQ,GAAG,CAAC;;IAEpC;IACA,MAAMC,MAAM,GAAGV,KAAK,CAACW,QAAQ,CAACN,MAAM,CAAC;;IAErC;IACA,MAAMO,EAAE,GAAGN,OAAO,CAAC,CAAC;IAEpB,MAAMO,eAAe,GACnBR,MAAM,CAACS,IAAI,KAAK,gBAAgB,IAAIT,MAAM,CAACA,MAAM,GAAGA,MAAM,CAACA,MAAM,GAAGA,MAAM;IAE5E,MAAMU,WAAW,GAAGb,UAAU,CAACc,IAAI,CAAEC,SAAS,IAAK;MACjD,IAAI,OAAOA,SAAS,KAAK,QAAQ,EAAE;QACjC,OAAOJ,eAAe,CAACC,IAAI,KAAKG,SAAS;MAC3C,CAAC,MAAM,IAAI,OAAOA,SAAS,KAAK,UAAU,EAAE;QAC1C,OAAOA,SAAS,CAACJ,eAAe,CAACC,IAAI,CAAC;MACxC,CAAC,MAAM,IAAIG,SAAS,YAAYC,MAAM,EAAE;QACtC,OAAOD,SAAS,CAACE,IAAI,CAACN,eAAe,CAACC,IAAI,CAAC;MAC7C,CAAC,MAAM;QACL,OAAO,KAAK;MACd;IACF,CAAC,CAAC;;IAEF;IACA;IACA,IAAI,CAACC,WAAW,EAAE;MAChB;MACA,IAAIK,SAAS,GAAG,KAAK;MACrB,IAAInB,YAAY,IAAI,OAAOA,YAAY,CAACoB,iBAAiB,KAAK,UAAU,EAAE;QACxED,SAAS,GAAG,CAAC,CAACnB,YAAY,CAACoB,iBAAiB,CAACR,eAAe,CAAC;MAC/D;MACA,MAAMS,KAAK,GAAGtB,KAAK,EAAES,QAAQ,GAAG,CAAC;MACjCV,UAAU,CAACwB,iBAAiB,CAACV,eAAe,EAAED,EAAE,EAAEQ,SAAS,EAAEvB,IAAI,CAACW,QAAQ,EAAEc,KAAK,CAAC,CAAC;IACrF;IAEA,OAAOZ,MAAM;EACf,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| import reactotronReducer from "./reducer.js"; | ||
| import createCustomDispatch from "./customDispatch.js"; | ||
| export default function createEnhancer(reactotron, pluginConfig, handleStoreCreation) { | ||
| return (skipSettingStore = false) => createStore => (reducer, ...args) => { | ||
| const originalStore = createStore(reactotronReducer(reducer, pluginConfig.restoreActionType), ...args); | ||
| const store = { | ||
| ...originalStore, | ||
| dispatch: createCustomDispatch(reactotron, originalStore, pluginConfig) | ||
| }; | ||
| if (!skipSettingStore) { | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| reactotron.reduxStore = store; | ||
| handleStoreCreation(); | ||
| } | ||
| return store; | ||
| }; | ||
| } | ||
| //# sourceMappingURL=enhancer.js.map |
| {"version":3,"names":["reactotronReducer","createCustomDispatch","createEnhancer","reactotron","pluginConfig","handleStoreCreation","skipSettingStore","createStore","reducer","args","originalStore","restoreActionType","store","dispatch","reduxStore"],"sourceRoot":"../../src","sources":["enhancer.ts"],"mappings":";;AAEA,OAAOA,iBAAiB,MAAM,cAAW;AACzC,OAAOC,oBAAoB,MAAM,qBAAkB;AAGnD,eAAe,SAASC,cAAcA,CACpCC,UAAkB,EAClBC,YAA0B,EAC1BC,mBAA+B,EAC/B;EACA,OAAO,CAACC,gBAAgB,GAAG,KAAK,KAC7BC,WAAW,IACZ,CAACC,OAAO,EAAE,GAAGC,IAAI,KAAK;IACpB,MAAMC,aAAa,GAAGH,WAAW,CAC/BP,iBAAiB,CAACQ,OAAO,EAAEJ,YAAY,CAACO,iBAAiB,CAAC,EAC1D,GAAGF,IACL,CAAC;IACD,MAAMG,KAAK,GAAG;MACZ,GAAGF,aAAa;MAChBG,QAAQ,EAAEZ,oBAAoB,CAACE,UAAU,EAAEO,aAAa,EAAEN,YAAY;IACxE,CAAC;IAED,IAAI,CAACE,gBAAgB,EAAE;MACrB;MACA;MACAH,UAAU,CAACW,UAAU,GAAGF,KAAK;MAC7BP,mBAAmB,CAAC,CAAC;IACvB;IAEA,OAAOO,KAAK;EACd,CAAC;AACL","ignoreList":[]} |
| "use strict"; | ||
| export default function pathObject(path, obj) { | ||
| if (!path) return obj; | ||
| const splitPaths = path.split("."); | ||
| let pathedObj = obj; | ||
| for (let i = 0; i < splitPaths.length; i++) { | ||
| const curPath = splitPaths[i]; | ||
| pathedObj = pathedObj[curPath]; | ||
| if (i < splitPaths.length - 1 && typeof pathedObj !== "object") { | ||
| pathedObj = undefined; | ||
| break; | ||
| } | ||
| } | ||
| return pathedObj; | ||
| } | ||
| //# sourceMappingURL=pathObject.js.map |
| {"version":3,"names":["pathObject","path","obj","splitPaths","split","pathedObj","i","length","curPath","undefined"],"sourceRoot":"../../../src","sources":["helpers/pathObject.ts"],"mappings":";;AAAA,eAAe,SAASA,UAAUA,CAACC,IAAY,EAAEC,GAAQ,EAAE;EACzD,IAAI,CAACD,IAAI,EAAE,OAAOC,GAAG;EAErB,MAAMC,UAAU,GAAGF,IAAI,CAACG,KAAK,CAAC,GAAG,CAAC;EAElC,IAAIC,SAAS,GAAGH,GAAG;EAEnB,KAAK,IAAII,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGH,UAAU,CAACI,MAAM,EAAED,CAAC,EAAE,EAAE;IAC1C,MAAME,OAAO,GAAGL,UAAU,CAACG,CAAC,CAAC;IAC7BD,SAAS,GAAGA,SAAS,CAACG,OAAO,CAAC;IAE9B,IAAIF,CAAC,GAAGH,UAAU,CAACI,MAAM,GAAG,CAAC,IAAI,OAAOF,SAAS,KAAK,QAAQ,EAAE;MAC9DA,SAAS,GAAGI,SAAS;MACrB;IACF;EACF;EAEA,OAAOJ,SAAS;AAClB","ignoreList":[]} |
| "use strict"; | ||
| export default state => { | ||
| // If we have a toJS, lets assume we need to call it to get a plan 'ol JS object | ||
| // NOTE: This handles ImmutableJS | ||
| if (state.toJS) { | ||
| return state.toJS(); | ||
| } | ||
| return state; | ||
| }; | ||
| //# sourceMappingURL=stateCleaner.js.map |
| {"version":3,"names":["state","toJS"],"sourceRoot":"../../../src","sources":["helpers/stateCleaner.ts"],"mappings":";;AAAA,eAAgBA,KAAU,IAAK;EAC7B;EACA;EACA,IAAIA,KAAK,CAACC,IAAI,EAAE;IACd,OAAOD,KAAK,CAACC,IAAI,CAAC,CAAC;EACrB;EAEA,OAAOD,KAAK;AACd,CAAC","ignoreList":[]} |
| "use strict"; | ||
| import createCommandHander from "./commandHandler.js"; | ||
| import createSendAction from "./sendAction.js"; | ||
| import createEnhancer from "./enhancer.js"; | ||
| import { DEFAULT_REPLACER_TYPE } from "./reducer.js"; | ||
| function reactotronRedux(pluginConfig = {}) { | ||
| const mergedPluginConfig = { | ||
| ...pluginConfig, | ||
| restoreActionType: pluginConfig.restoreActionType || DEFAULT_REPLACER_TYPE | ||
| }; | ||
| const storeCreationHandlers = []; | ||
| const onReduxStoreCreation = func => { | ||
| storeCreationHandlers.push(func); | ||
| }; | ||
| const handleStoreCreation = () => { | ||
| storeCreationHandlers.forEach(func => { | ||
| func(); | ||
| }); | ||
| }; | ||
| function plugin(reactotron) { | ||
| return { | ||
| // Fires when we receive a command from the Reactotron app. | ||
| onCommand: createCommandHander(reactotron, mergedPluginConfig, onReduxStoreCreation), | ||
| // All keys in this object will be attached to the main Reactotron instance | ||
| // and available to be called directly. | ||
| features: { | ||
| createEnhancer: createEnhancer(reactotron, mergedPluginConfig, handleStoreCreation), | ||
| setReduxStore: store => { | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| reactotron.reduxStore = store; | ||
| handleStoreCreation(); | ||
| }, | ||
| reportReduxAction: createSendAction(reactotron) | ||
| } | ||
| }; | ||
| } | ||
| return plugin; | ||
| } | ||
| export { reactotronRedux }; | ||
| //# sourceMappingURL=index.js.map |
| {"version":3,"names":["createCommandHander","createSendAction","createEnhancer","DEFAULT_REPLACER_TYPE","reactotronRedux","pluginConfig","mergedPluginConfig","restoreActionType","storeCreationHandlers","onReduxStoreCreation","func","push","handleStoreCreation","forEach","plugin","reactotron","onCommand","features","setReduxStore","store","reduxStore","reportReduxAction"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;AAEA,OAAOA,mBAAmB,MAAM,qBAAkB;AAClD,OAAOC,gBAAgB,MAAM,iBAAc;AAC3C,OAAOC,cAAc,MAAM,eAAY;AACvC,SAASC,qBAAqB,QAAQ,cAAW;AAGjD,SAASC,eAAeA,CAACC,YAA0B,GAAG,CAAC,CAAC,EAAE;EACxD,MAAMC,kBAAgC,GAAG;IACvC,GAAGD,YAAY;IACfE,iBAAiB,EAAEF,YAAY,CAACE,iBAAiB,IAAIJ;EACvD,CAAC;EAED,MAAMK,qBAAqC,GAAG,EAAE;EAChD,MAAMC,oBAAoB,GAAIC,IAAgB,IAAK;IACjDF,qBAAqB,CAACG,IAAI,CAACD,IAAI,CAAC;EAClC,CAAC;EACD,MAAME,mBAAmB,GAAGA,CAAA,KAAM;IAChCJ,qBAAqB,CAACK,OAAO,CAAEH,IAAI,IAAK;MACtCA,IAAI,CAAC,CAAC;IACR,CAAC,CAAC;EACJ,CAAC;EAED,SAASI,MAAMA,CAAiDC,UAAkB,EAAE;IAClF,OAAO;MACL;MACAC,SAAS,EAAEhB,mBAAmB,CAACe,UAAU,EAAET,kBAAkB,EAAEG,oBAAoB,CAAC;MAEpF;MACA;MACAQ,QAAQ,EAAE;QACRf,cAAc,EAAEA,cAAc,CAACa,UAAU,EAAET,kBAAkB,EAAEM,mBAAmB,CAAC;QACnFM,aAAa,EAAGC,KAAK,IAAK;UACxB;UACA;UACAJ,UAAU,CAACK,UAAU,GAAGD,KAAK;UAC7BP,mBAAmB,CAAC,CAAC;QACvB,CAAC;QACDS,iBAAiB,EAAEpB,gBAAgB,CAACc,UAAU;MAChD;IACF,CAAC;EACH;EAEA,OAAOD,MAAM;AACf;AAIA,SAASV,eAAe","ignoreList":[]} |
| {"type":"module"} |
| "use strict"; | ||
| //# sourceMappingURL=pluginConfig.js.map |
| {"version":3,"names":[],"sourceRoot":"../../src","sources":["pluginConfig.ts"],"mappings":"","ignoreList":[]} |
| "use strict"; | ||
| export const DEFAULT_REPLACER_TYPE = "REACTOTRON_RESTORE_STATE"; | ||
| export default function reactotronReducer( | ||
| // eslint-disable-next-line @typescript-eslint/ban-types | ||
| rootReducer, actionName = DEFAULT_REPLACER_TYPE) { | ||
| // return this reducer | ||
| return (state, action) => { | ||
| // is this action the one we're waiting for? if so, use the state it passed | ||
| const whichState = action.type === actionName ? action.state : state; | ||
| return rootReducer(whichState, action); | ||
| }; | ||
| } | ||
| //# sourceMappingURL=reducer.js.map |
| {"version":3,"names":["DEFAULT_REPLACER_TYPE","reactotronReducer","rootReducer","actionName","state","action","whichState","type"],"sourceRoot":"../../src","sources":["reducer.ts"],"mappings":";;AAAA,OAAO,MAAMA,qBAAqB,GAAG,0BAA0B;AAE/D,eAAe,SAASC,iBAAiBA;AACvC;AACAC,WAAqB,EACrBC,UAAU,GAAGH,qBAAqB,EAClC;EACA;EACA,OAAO,CAACI,KAAU,EAAEC,MAAqC,KAAK;IAC5D;IACA,MAAMC,UAAU,GAAGD,MAAM,CAACE,IAAI,KAAKJ,UAAU,GAAGE,MAAM,CAACD,KAAK,GAAGA,KAAK;IACpE,OAAOF,WAAW,CAACI,UAAU,EAAED,MAAM,CAAC;EACxC,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| export default function createSendAction(reactotron) { | ||
| return (action, ms, important = false, diff) => { | ||
| // let's call the type, name because that's "generic" name in Reactotron | ||
| let { | ||
| type: name | ||
| } = action; | ||
| // convert from symbol to type if necessary | ||
| if (typeof name === "symbol") { | ||
| name = name.toString().replace(/^Symbol\(/, "").replace(/\)$/, ""); | ||
| } | ||
| // off ya go! | ||
| reactotron.send("state.action.complete", { | ||
| name, | ||
| action, | ||
| ms, | ||
| diff | ||
| }, important); | ||
| }; | ||
| } | ||
| //# sourceMappingURL=sendAction.js.map |
| {"version":3,"names":["createSendAction","reactotron","action","ms","important","diff","type","name","toString","replace","send"],"sourceRoot":"../../src","sources":["sendAction.ts"],"mappings":";;AAEA,eAAe,SAASA,gBAAgBA,CACtCC,UAAkB,EAClB;EACA,OAAO,CAACC,MAAqB,EAAEC,EAAU,EAAEC,SAAS,GAAG,KAAK,EAAEC,IAAU,KAAK;IAC3E;IACA,IAAI;MAAEC,IAAI,EAAEC;IAAK,CAAC,GAAGL,MAAM;;IAE3B;IACA,IAAI,OAAOK,IAAI,KAAK,QAAQ,EAAE;MAC5BA,IAAI,GAAGA,IAAI,CACRC,QAAQ,CAAC,CAAC,CACVC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CACxBA,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;IACvB;;IAEA;IACAR,UAAU,CAACS,IAAI,CAAC,uBAAuB,EAAE;MAAEH,IAAI;MAAEL,MAAM;MAAEC,EAAE;MAAEE;IAAK,CAAC,EAAED,SAAS,CAAC;EACjF,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| import pathObject from "./helpers/pathObject.js"; | ||
| export default function createSubscriptionHandler(reactotron, onReduxStoreCreation) { | ||
| let subscriptions = []; | ||
| function setSubscriptions(subs) { | ||
| subscriptions = subs; | ||
| } | ||
| function getChanges() { | ||
| // If we don't have reactotron, dont have a store or getState isn't a function then get out. Now. | ||
| if (!reactotron || !reactotron.reduxStore || typeof reactotron.reduxStore.getState !== "function") { | ||
| return []; | ||
| } | ||
| const state = reactotron.reduxStore.getState(); | ||
| const changes = []; | ||
| subscriptions.forEach(path => { | ||
| let cleanedPath = path; | ||
| let starredPath = false; | ||
| if (path && path.endsWith("*")) { | ||
| // Handle the star! | ||
| starredPath = true; | ||
| cleanedPath = path.substr(0, path.length - 2); | ||
| } | ||
| const values = pathObject(cleanedPath, state); | ||
| if (starredPath && cleanedPath && values) { | ||
| changes.push(...Object.entries(values).map(val => ({ | ||
| path: `${cleanedPath}.${val[0]}`, | ||
| value: val[1] | ||
| }))); | ||
| } else { | ||
| changes.push({ | ||
| path: cleanedPath, | ||
| value: values | ||
| }); | ||
| } | ||
| }); | ||
| return changes; | ||
| } | ||
| function sendSubscriptions() { | ||
| const changes = getChanges(); | ||
| reactotron.stateValuesChange(changes); | ||
| } | ||
| function sendSubscriptionsIfNeeded() { | ||
| const changes = getChanges(); | ||
| if (changes.length > 0) { | ||
| reactotron.stateValuesChange(changes); | ||
| } | ||
| } | ||
| onReduxStoreCreation(() => { | ||
| reactotron.reduxStore.subscribe(sendSubscriptionsIfNeeded); | ||
| }); | ||
| return { | ||
| sendSubscriptions, | ||
| sendSubscriptionsIfNeeded, | ||
| setSubscriptions | ||
| }; | ||
| } | ||
| //# sourceMappingURL=subscriptionsHandler.js.map |
| {"version":3,"names":["pathObject","createSubscriptionHandler","reactotron","onReduxStoreCreation","subscriptions","setSubscriptions","subs","getChanges","reduxStore","getState","state","changes","forEach","path","cleanedPath","starredPath","endsWith","substr","length","values","push","Object","entries","map","val","value","sendSubscriptions","stateValuesChange","sendSubscriptionsIfNeeded","subscribe"],"sourceRoot":"../../src","sources":["subscriptionsHandler.ts"],"mappings":";;AAAA,OAAOA,UAAU,MAAM,yBAAsB;AAE7C,eAAe,SAASC,yBAAyBA,CAC/CC,UAAe,EACfC,oBAAgD,EAChD;EACA,IAAIC,aAAuB,GAAG,EAAE;EAEhC,SAASC,gBAAgBA,CAACC,IAAc,EAAE;IACxCF,aAAa,GAAGE,IAAI;EACtB;EAEA,SAASC,UAAUA,CAAA,EAAG;IACpB;IACA,IACE,CAACL,UAAU,IACX,CAACA,UAAU,CAACM,UAAU,IACtB,OAAON,UAAU,CAACM,UAAU,CAACC,QAAQ,KAAK,UAAU,EACpD;MACA,OAAO,EAAE;IACX;IAEA,MAAMC,KAAK,GAAGR,UAAU,CAACM,UAAU,CAACC,QAAQ,CAAC,CAAC;IAE9C,MAAME,OAAO,GAAG,EAAE;IAElBP,aAAa,CAACQ,OAAO,CAAEC,IAAI,IAAK;MAC9B,IAAIC,WAAW,GAAGD,IAAI;MACtB,IAAIE,WAAW,GAAG,KAAK;MAEvB,IAAIF,IAAI,IAAIA,IAAI,CAACG,QAAQ,CAAC,GAAG,CAAC,EAAE;QAC9B;QACAD,WAAW,GAAG,IAAI;QAClBD,WAAW,GAAGD,IAAI,CAACI,MAAM,CAAC,CAAC,EAAEJ,IAAI,CAACK,MAAM,GAAG,CAAC,CAAC;MAC/C;MAEA,MAAMC,MAAM,GAAGnB,UAAU,CAACc,WAAW,EAAEJ,KAAK,CAAC;MAE7C,IAAIK,WAAW,IAAID,WAAW,IAAIK,MAAM,EAAE;QACxCR,OAAO,CAACS,IAAI,CACV,GAAGC,MAAM,CAACC,OAAO,CAACH,MAAM,CAAC,CAACI,GAAG,CAAEC,GAAG,KAAM;UACtCX,IAAI,EAAE,GAAGC,WAAW,IAAIU,GAAG,CAAC,CAAC,CAAC,EAAE;UAChCC,KAAK,EAAED,GAAG,CAAC,CAAC;QACd,CAAC,CAAC,CACJ,CAAC;MACH,CAAC,MAAM;QACLb,OAAO,CAACS,IAAI,CAAC;UAAEP,IAAI,EAAEC,WAAW;UAAEW,KAAK,EAAEN;QAAO,CAAC,CAAC;MACpD;IACF,CAAC,CAAC;IAEF,OAAOR,OAAO;EAChB;EAEA,SAASe,iBAAiBA,CAAA,EAAG;IAC3B,MAAMf,OAAO,GAAGJ,UAAU,CAAC,CAAC;IAC5BL,UAAU,CAACyB,iBAAiB,CAAChB,OAAO,CAAC;EACvC;EAEA,SAASiB,yBAAyBA,CAAA,EAAG;IACnC,MAAMjB,OAAO,GAAGJ,UAAU,CAAC,CAAC;IAE5B,IAAII,OAAO,CAACO,MAAM,GAAG,CAAC,EAAE;MACtBhB,UAAU,CAACyB,iBAAiB,CAAChB,OAAO,CAAC;IACvC;EACF;EAEAR,oBAAoB,CAAC,MAAM;IACzBD,UAAU,CAACM,UAAU,CAACqB,SAAS,CAACD,yBAAyB,CAAC;EAC5D,CAAC,CAAC;EAEF,OAAO;IACLF,iBAAiB;IACjBE,yBAAyB;IACzBvB;EACF,CAAC;AACH","ignoreList":[]} |
| "use strict"; | ||
| export const defaultReactotronMock = { | ||
| startTimer: jest.fn(), | ||
| configure: jest.fn(), | ||
| close: jest.fn(), | ||
| connect: jest.fn(), | ||
| send: jest.fn(), | ||
| display: jest.fn(), | ||
| use: jest.fn(), | ||
| onCustomCommand: jest.fn(), | ||
| clear: jest.fn(), | ||
| apiResponse: jest.fn(), | ||
| benchmark: jest.fn(), | ||
| debug: jest.fn(), | ||
| error: jest.fn(), | ||
| image: jest.fn(), | ||
| log: jest.fn(), | ||
| logImportant: jest.fn(), | ||
| plugins: [], | ||
| options: {}, | ||
| repl: jest.fn(), | ||
| stateActionComplete: jest.fn(), | ||
| stateBackupResponse: jest.fn(), | ||
| stateKeysResponse: jest.fn(), | ||
| stateValuesChange: jest.fn(), | ||
| stateValuesResponse: jest.fn(), | ||
| warn: jest.fn(), | ||
| createEnhancer: jest.fn(), | ||
| // eslint-disable-next-line @typescript-eslint/ban-ts-comment | ||
| // @ts-ignore shhhhhh -- this is a private API | ||
| reduxStore: jest.fn(), | ||
| setReduxStore: jest.fn() | ||
| }; | ||
| //# sourceMappingURL=testHelpers.js.map |
| {"version":3,"names":["defaultReactotronMock","startTimer","jest","fn","configure","close","connect","send","display","use","onCustomCommand","clear","apiResponse","benchmark","debug","error","image","log","logImportant","plugins","options","repl","stateActionComplete","stateBackupResponse","stateKeysResponse","stateValuesChange","stateValuesResponse","warn","createEnhancer","reduxStore","setReduxStore"],"sourceRoot":"../../src","sources":["testHelpers.ts"],"mappings":";;AAGA,OAAO,MAAMA,qBAAoF,GAC/F;EACEC,UAAU,EAAEC,IAAI,CAACC,EAAE,CAAC,CAAC;EACrBC,SAAS,EAAEF,IAAI,CAACC,EAAE,CAAC,CAAC;EACpBE,KAAK,EAAEH,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBG,OAAO,EAAEJ,IAAI,CAACC,EAAE,CAAC,CAAC;EAClBI,IAAI,EAAEL,IAAI,CAACC,EAAE,CAAC,CAAC;EACfK,OAAO,EAAEN,IAAI,CAACC,EAAE,CAAC,CAAC;EAClBM,GAAG,EAAEP,IAAI,CAACC,EAAE,CAAC,CAAC;EACdO,eAAe,EAAER,IAAI,CAACC,EAAE,CAAC,CAAC;EAC1BQ,KAAK,EAAET,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBS,WAAW,EAAEV,IAAI,CAACC,EAAE,CAAC,CAAC;EACtBU,SAAS,EAAEX,IAAI,CAACC,EAAE,CAAC,CAAC;EACpBW,KAAK,EAAEZ,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBY,KAAK,EAAEb,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBa,KAAK,EAAEd,IAAI,CAACC,EAAE,CAAC,CAAC;EAChBc,GAAG,EAAEf,IAAI,CAACC,EAAE,CAAC,CAAC;EACde,YAAY,EAAEhB,IAAI,CAACC,EAAE,CAAC,CAAC;EACvBgB,OAAO,EAAE,EAAE;EACXC,OAAO,EAAE,CAAC,CAAC;EACXC,IAAI,EAAEnB,IAAI,CAACC,EAAE,CAAC,CAAC;EACfmB,mBAAmB,EAAEpB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC9BoB,mBAAmB,EAAErB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC9BqB,iBAAiB,EAAEtB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC5BsB,iBAAiB,EAAEvB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC5BuB,mBAAmB,EAAExB,IAAI,CAACC,EAAE,CAAC,CAAC;EAC9BwB,IAAI,EAAEzB,IAAI,CAACC,EAAE,CAAC,CAAC;EACfyB,cAAc,EAAE1B,IAAI,CAACC,EAAE,CAAC,CAAC;EACzB;EACA;EACA0B,UAAU,EAAE3B,IAAI,CAACC,EAAE,CAAC,CAAC;EACrB2B,aAAa,EAAE5B,IAAI,CAACC,EAAE,CAAC;AACzB,CAAC","ignoreList":[]} |
| {"type":"commonjs"} |
| import { type ReactotronCore } from "reactotron-core-client"; | ||
| import { PluginConfig } from "./pluginConfig"; | ||
| export default function createCommandHandler<Client extends ReactotronCore = ReactotronCore>(reactotron: Client, pluginConfig: PluginConfig, onReduxStoreCreation: (func: () => void) => void): ({ type, payload }: { | ||
| type: string; | ||
| payload?: any; | ||
| }) => void; | ||
| //# sourceMappingURL=commandHandler.d.ts.map |
| {"version":3,"file":"commandHandler.d.ts","sourceRoot":"","sources":["../../../../src/commandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,wBAAwB,CAAA;AAK/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAM,SAAS,cAAc,GAAG,cAAc,EACzF,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI;UASb,MAAM;cAAY,GAAG;WA+EzD"} |
| export {}; | ||
| //# sourceMappingURL=commandHandler.test.d.ts.map |
| {"version":3,"file":"commandHandler.test.d.ts","sourceRoot":"","sources":["../../../../src/commandHandler.test.ts"],"names":[],"mappings":""} |
| import { PluginConfig } from "./pluginConfig"; | ||
| export default function createCustomDispatch(reactotron: any, store: { | ||
| dispatch: Function; | ||
| getState?: Function; | ||
| }, pluginConfig: PluginConfig): (action: any) => any; | ||
| //# sourceMappingURL=customDispatch.d.ts.map |
| {"version":3,"file":"customDispatch.d.ts","sourceRoot":"","sources":["../../../../src/customDispatch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,UAAU,EAAE,GAAG,EAEf,KAAK,EAAE;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,EAClD,YAAY,EAAE,YAAY,YAIV,GAAG,SA0CpB"} |
| export {}; | ||
| //# sourceMappingURL=customDispatch.test.d.ts.map |
| {"version":3,"file":"customDispatch.test.d.ts","sourceRoot":"","sources":["../../../../src/customDispatch.test.ts"],"names":[],"mappings":""} |
| import type { ReactotronCore } from "reactotron-core-client"; | ||
| import { PluginConfig } from "./pluginConfig"; | ||
| export default function createEnhancer<Client extends ReactotronCore = ReactotronCore>(reactotron: Client, pluginConfig: PluginConfig, handleStoreCreation: () => void): (skipSettingStore?: boolean) => (createStore: any) => (reducer: any, ...args: any[]) => any; | ||
| //# sourceMappingURL=enhancer.d.ts.map |
| {"version":3,"file":"enhancer.d.ts","sourceRoot":"","sources":["../../../../src/enhancer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAM,SAAS,cAAc,GAAG,cAAc,EACnF,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,MAAM,IAAI,+FAuBhC"} |
| export {}; | ||
| //# sourceMappingURL=enhancer.test.d.ts.map |
| {"version":3,"file":"enhancer.test.d.ts","sourceRoot":"","sources":["../../../../src/enhancer.test.ts"],"names":[],"mappings":""} |
| export default function pathObject(path: string, obj: any): any; | ||
| //# sourceMappingURL=pathObject.d.ts.map |
| {"version":3,"file":"pathObject.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/pathObject.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,OAkBxD"} |
| export {}; | ||
| //# sourceMappingURL=pathObject.test.d.ts.map |
| {"version":3,"file":"pathObject.test.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/pathObject.test.ts"],"names":[],"mappings":""} |
| declare const _default: (state: any) => any; | ||
| export default _default; | ||
| //# sourceMappingURL=stateCleaner.d.ts.map |
| {"version":3,"file":"stateCleaner.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/stateCleaner.ts"],"names":[],"mappings":"gCAAuB,GAAG;AAA1B,wBAQC"} |
| export {}; | ||
| //# sourceMappingURL=stateCleaner.test.d.ts.map |
| {"version":3,"file":"stateCleaner.test.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/stateCleaner.test.ts"],"names":[],"mappings":""} |
| import type { ReactotronCore } from "reactotron-core-client"; | ||
| import { PluginConfig } from "./pluginConfig"; | ||
| declare function reactotronRedux(pluginConfig?: PluginConfig): <Client extends ReactotronCore = ReactotronCore>(reactotron: Client) => { | ||
| onCommand: ({ type, payload }: { | ||
| type: string; | ||
| payload?: any; | ||
| }) => void; | ||
| features: { | ||
| createEnhancer: (skipSettingStore?: boolean) => (createStore: any) => (reducer: any, ...args: any[]) => any; | ||
| setReduxStore: (store: any) => void; | ||
| reportReduxAction: (action: { | ||
| type: any; | ||
| }, ms: number, important?: boolean, diff?: any) => void; | ||
| }; | ||
| }; | ||
| export type ReactotronReduxPlugin = ReturnType<typeof reactotronRedux>; | ||
| export { reactotronRedux }; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAMpE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,iBAAS,eAAe,CAAC,YAAY,GAAE,YAAiB;;;;;;;;;;;;EAqCvD;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAEtE,OAAO,EAAE,eAAe,EAAE,CAAA"} |
| export interface PluginConfig { | ||
| restoreActionType?: string; | ||
| onBackup?: (state: any) => any; | ||
| onRestore?: (restoringState: any, reduxState: any) => any; | ||
| except?: (string | Function | RegExp)[]; | ||
| isActionImportant?: (action: any) => boolean; | ||
| } | ||
| //# sourceMappingURL=pluginConfig.d.ts.map |
| {"version":3,"file":"pluginConfig.d.ts","sourceRoot":"","sources":["../../../../src/pluginConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;IAC9B,SAAS,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,KAAK,GAAG,CAAA;IAEzD,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAA;IACvC,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAA;CAC7C"} |
| export declare const DEFAULT_REPLACER_TYPE = "REACTOTRON_RESTORE_STATE"; | ||
| export default function reactotronReducer(rootReducer: Function, actionName?: string): (state: any, action: { | ||
| type: string; | ||
| state?: any; | ||
| }) => any; | ||
| //# sourceMappingURL=reducer.d.ts.map |
| {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../../src/reducer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,6BAA6B,CAAA;AAE/D,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAEvC,WAAW,EAAE,QAAQ,EACrB,UAAU,SAAwB,WAGnB,GAAG;UAAkB,MAAM;YAAU,GAAG;UAKxD"} |
| export {}; | ||
| //# sourceMappingURL=reducer.test.d.ts.map |
| {"version":3,"file":"reducer.test.d.ts","sourceRoot":"","sources":["../../../../src/reducer.test.ts"],"names":[],"mappings":""} |
| import type { ReactotronCore } from "reactotron-core-client"; | ||
| export default function createSendAction<Client extends ReactotronCore = ReactotronCore>(reactotron: Client): (action: { | ||
| type: any; | ||
| }, ms: number, important?: boolean, diff?: any) => void; | ||
| //# sourceMappingURL=sendAction.d.ts.map |
| {"version":3,"file":"sendAction.d.ts","sourceRoot":"","sources":["../../../../src/sendAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,MAAM,SAAS,cAAc,GAAG,cAAc,EACrF,UAAU,EAAE,MAAM,YAEF;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,MAAM,MAAM,8BAA4B,GAAG,UAezE"} |
| export {}; | ||
| //# sourceMappingURL=sendAction.test.d.ts.map |
| {"version":3,"file":"sendAction.test.d.ts","sourceRoot":"","sources":["../../../../src/sendAction.test.ts"],"names":[],"mappings":""} |
| export default function createSubscriptionHandler(reactotron: any, onReduxStoreCreation: (func: () => void) => void): { | ||
| sendSubscriptions: () => void; | ||
| sendSubscriptionsIfNeeded: () => void; | ||
| setSubscriptions: (subs: string[]) => void; | ||
| }; | ||
| //# sourceMappingURL=subscriptionsHandler.d.ts.map |
| {"version":3,"file":"subscriptionsHandler.d.ts","sourceRoot":"","sources":["../../../../src/subscriptionsHandler.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAC/C,UAAU,EAAE,GAAG,EACf,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI;;;6BAIhB,MAAM,EAAE;EAmEzC"} |
| export {}; | ||
| //# sourceMappingURL=subscriptionsHandler.test.d.ts.map |
| {"version":3,"file":"subscriptionsHandler.test.d.ts","sourceRoot":"","sources":["../../../../src/subscriptionsHandler.test.ts"],"names":[],"mappings":""} |
| import type { InferFeatures, Reactotron } from "reactotron-core-client"; | ||
| import type { ReactotronReduxPlugin } from "."; | ||
| export declare const defaultReactotronMock: Reactotron & InferFeatures<Reactotron, ReactotronReduxPlugin>; | ||
| //# sourceMappingURL=testHelpers.d.ts.map |
| {"version":3,"file":"testHelpers.d.ts","sourceRoot":"","sources":["../../../../src/testHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,GAAG,CAAA;AAE9C,eAAO,MAAM,qBAAqB,EAAE,UAAU,GAAG,aAAa,CAAC,UAAU,EAAE,qBAAqB,CAgC7F,CAAA"} |
| {"type":"module"} |
| import { type ReactotronCore } from "reactotron-core-client"; | ||
| import { PluginConfig } from "./pluginConfig"; | ||
| export default function createCommandHandler<Client extends ReactotronCore = ReactotronCore>(reactotron: Client, pluginConfig: PluginConfig, onReduxStoreCreation: (func: () => void) => void): ({ type, payload }: { | ||
| type: string; | ||
| payload?: any; | ||
| }) => void; | ||
| //# sourceMappingURL=commandHandler.d.ts.map |
| {"version":3,"file":"commandHandler.d.ts","sourceRoot":"","sources":["../../../../src/commandHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAGpB,MAAM,wBAAwB,CAAA;AAK/B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,MAAM,SAAS,cAAc,GAAG,cAAc,EACzF,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI;UASb,MAAM;cAAY,GAAG;WA+EzD"} |
| export {}; | ||
| //# sourceMappingURL=commandHandler.test.d.ts.map |
| {"version":3,"file":"commandHandler.test.d.ts","sourceRoot":"","sources":["../../../../src/commandHandler.test.ts"],"names":[],"mappings":""} |
| import { PluginConfig } from "./pluginConfig"; | ||
| export default function createCustomDispatch(reactotron: any, store: { | ||
| dispatch: Function; | ||
| getState?: Function; | ||
| }, pluginConfig: PluginConfig): (action: any) => any; | ||
| //# sourceMappingURL=customDispatch.d.ts.map |
| {"version":3,"file":"customDispatch.d.ts","sourceRoot":"","sources":["../../../../src/customDispatch.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAC1C,UAAU,EAAE,GAAG,EAEf,KAAK,EAAE;IAAE,QAAQ,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,EAAE,QAAQ,CAAA;CAAE,EAClD,YAAY,EAAE,YAAY,YAIV,GAAG,SA0CpB"} |
| export {}; | ||
| //# sourceMappingURL=customDispatch.test.d.ts.map |
| {"version":3,"file":"customDispatch.test.d.ts","sourceRoot":"","sources":["../../../../src/customDispatch.test.ts"],"names":[],"mappings":""} |
| import type { ReactotronCore } from "reactotron-core-client"; | ||
| import { PluginConfig } from "./pluginConfig"; | ||
| export default function createEnhancer<Client extends ReactotronCore = ReactotronCore>(reactotron: Client, pluginConfig: PluginConfig, handleStoreCreation: () => void): (skipSettingStore?: boolean) => (createStore: any) => (reducer: any, ...args: any[]) => any; | ||
| //# sourceMappingURL=enhancer.d.ts.map |
| {"version":3,"file":"enhancer.d.ts","sourceRoot":"","sources":["../../../../src/enhancer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAI5D,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,MAAM,SAAS,cAAc,GAAG,cAAc,EACnF,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,YAAY,EAC1B,mBAAmB,EAAE,MAAM,IAAI,+FAuBhC"} |
| export {}; | ||
| //# sourceMappingURL=enhancer.test.d.ts.map |
| {"version":3,"file":"enhancer.test.d.ts","sourceRoot":"","sources":["../../../../src/enhancer.test.ts"],"names":[],"mappings":""} |
| export default function pathObject(path: string, obj: any): any; | ||
| //# sourceMappingURL=pathObject.d.ts.map |
| {"version":3,"file":"pathObject.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/pathObject.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,OAkBxD"} |
| export {}; | ||
| //# sourceMappingURL=pathObject.test.d.ts.map |
| {"version":3,"file":"pathObject.test.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/pathObject.test.ts"],"names":[],"mappings":""} |
| declare const _default: (state: any) => any; | ||
| export default _default; | ||
| //# sourceMappingURL=stateCleaner.d.ts.map |
| {"version":3,"file":"stateCleaner.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/stateCleaner.ts"],"names":[],"mappings":"gCAAuB,GAAG;AAA1B,wBAQC"} |
| export {}; | ||
| //# sourceMappingURL=stateCleaner.test.d.ts.map |
| {"version":3,"file":"stateCleaner.test.d.ts","sourceRoot":"","sources":["../../../../../src/helpers/stateCleaner.test.ts"],"names":[],"mappings":""} |
| import type { ReactotronCore } from "reactotron-core-client"; | ||
| import { PluginConfig } from "./pluginConfig"; | ||
| declare function reactotronRedux(pluginConfig?: PluginConfig): <Client extends ReactotronCore = ReactotronCore>(reactotron: Client) => { | ||
| onCommand: ({ type, payload }: { | ||
| type: string; | ||
| payload?: any; | ||
| }) => void; | ||
| features: { | ||
| createEnhancer: (skipSettingStore?: boolean) => (createStore: any) => (reducer: any, ...args: any[]) => any; | ||
| setReduxStore: (store: any) => void; | ||
| reportReduxAction: (action: { | ||
| type: any; | ||
| }, ms: number, important?: boolean, diff?: any) => void; | ||
| }; | ||
| }; | ||
| export type ReactotronReduxPlugin = ReturnType<typeof reactotronRedux>; | ||
| export { reactotronRedux }; | ||
| //# sourceMappingURL=index.d.ts.map |
| {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAMpE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAE7C,iBAAS,eAAe,CAAC,YAAY,GAAE,YAAiB;;;;;;;;;;;;EAqCvD;AAED,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,eAAe,CAAC,CAAA;AAEtE,OAAO,EAAE,eAAe,EAAE,CAAA"} |
| export interface PluginConfig { | ||
| restoreActionType?: string; | ||
| onBackup?: (state: any) => any; | ||
| onRestore?: (restoringState: any, reduxState: any) => any; | ||
| except?: (string | Function | RegExp)[]; | ||
| isActionImportant?: (action: any) => boolean; | ||
| } | ||
| //# sourceMappingURL=pluginConfig.d.ts.map |
| {"version":3,"file":"pluginConfig.d.ts","sourceRoot":"","sources":["../../../../src/pluginConfig.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAA;IAC9B,SAAS,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE,UAAU,EAAE,GAAG,KAAK,GAAG,CAAA;IAEzD,MAAM,CAAC,EAAE,CAAC,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC,EAAE,CAAA;IACvC,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,KAAK,OAAO,CAAA;CAC7C"} |
| export declare const DEFAULT_REPLACER_TYPE = "REACTOTRON_RESTORE_STATE"; | ||
| export default function reactotronReducer(rootReducer: Function, actionName?: string): (state: any, action: { | ||
| type: string; | ||
| state?: any; | ||
| }) => any; | ||
| //# sourceMappingURL=reducer.d.ts.map |
| {"version":3,"file":"reducer.d.ts","sourceRoot":"","sources":["../../../../src/reducer.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,qBAAqB,6BAA6B,CAAA;AAE/D,MAAM,CAAC,OAAO,UAAU,iBAAiB,CAEvC,WAAW,EAAE,QAAQ,EACrB,UAAU,SAAwB,WAGnB,GAAG;UAAkB,MAAM;YAAU,GAAG;UAKxD"} |
| export {}; | ||
| //# sourceMappingURL=reducer.test.d.ts.map |
| {"version":3,"file":"reducer.test.d.ts","sourceRoot":"","sources":["../../../../src/reducer.test.ts"],"names":[],"mappings":""} |
| import type { ReactotronCore } from "reactotron-core-client"; | ||
| export default function createSendAction<Client extends ReactotronCore = ReactotronCore>(reactotron: Client): (action: { | ||
| type: any; | ||
| }, ms: number, important?: boolean, diff?: any) => void; | ||
| //# sourceMappingURL=sendAction.d.ts.map |
| {"version":3,"file":"sendAction.d.ts","sourceRoot":"","sources":["../../../../src/sendAction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAE5D,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,MAAM,SAAS,cAAc,GAAG,cAAc,EACrF,UAAU,EAAE,MAAM,YAEF;IAAE,IAAI,EAAE,GAAG,CAAA;CAAE,MAAM,MAAM,8BAA4B,GAAG,UAezE"} |
| export {}; | ||
| //# sourceMappingURL=sendAction.test.d.ts.map |
| {"version":3,"file":"sendAction.test.d.ts","sourceRoot":"","sources":["../../../../src/sendAction.test.ts"],"names":[],"mappings":""} |
| export default function createSubscriptionHandler(reactotron: any, onReduxStoreCreation: (func: () => void) => void): { | ||
| sendSubscriptions: () => void; | ||
| sendSubscriptionsIfNeeded: () => void; | ||
| setSubscriptions: (subs: string[]) => void; | ||
| }; | ||
| //# sourceMappingURL=subscriptionsHandler.d.ts.map |
| {"version":3,"file":"subscriptionsHandler.d.ts","sourceRoot":"","sources":["../../../../src/subscriptionsHandler.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,yBAAyB,CAC/C,UAAU,EAAE,GAAG,EACf,oBAAoB,EAAE,CAAC,IAAI,EAAE,MAAM,IAAI,KAAK,IAAI;;;6BAIhB,MAAM,EAAE;EAmEzC"} |
| export {}; | ||
| //# sourceMappingURL=subscriptionsHandler.test.d.ts.map |
| {"version":3,"file":"subscriptionsHandler.test.d.ts","sourceRoot":"","sources":["../../../../src/subscriptionsHandler.test.ts"],"names":[],"mappings":""} |
| import type { InferFeatures, Reactotron } from "reactotron-core-client"; | ||
| import type { ReactotronReduxPlugin } from "."; | ||
| export declare const defaultReactotronMock: Reactotron & InferFeatures<Reactotron, ReactotronReduxPlugin>; | ||
| //# sourceMappingURL=testHelpers.d.ts.map |
| {"version":3,"file":"testHelpers.d.ts","sourceRoot":"","sources":["../../../../src/testHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AACvE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,GAAG,CAAA;AAE9C,eAAO,MAAM,qBAAqB,EAAE,UAAU,GAAG,aAAa,CAAC,UAAU,EAAE,qBAAqB,CAgC7F,CAAA"} |
+2
-0
@@ -5,2 +5,4 @@ # Changelog | ||
| ### [3.2.1](https://github.com/infinitered/reactotron/compare/reactotron-redux@3.2.0...reactotron-redux@3.2.1) (2025-09-16) | ||
| ## [3.2.0](https://github.com/infinitered/reactotron/compare/reactotron-redux@3.1.11...reactotron-redux@3.2.0) (2025-03-16) | ||
@@ -7,0 +9,0 @@ |
+33
-21
| { | ||
| "name": "reactotron-redux", | ||
| "version": "3.2.0", | ||
| "version": "3.2.1", | ||
| "description": "A Reactotron plugin for Redux.", | ||
@@ -16,10 +16,13 @@ "author": "Infinite Red", | ||
| ], | ||
| "main": "dist/index.js", | ||
| "module": "dist/index.esm.js", | ||
| "types": "dist/types/src/index.d.ts", | ||
| "react-native": "src/index.ts", | ||
| "main": "./dist/commonjs/index.js", | ||
| "module": "./dist/module/index.js", | ||
| "types": "./dist/typescript/commonjs/src/index.d.ts", | ||
| "exports": { | ||
| "import": "./dist/index.esm.js", | ||
| "types": "./dist/types/src/index.d.ts", | ||
| "default": "./dist/index.js" | ||
| ".": { | ||
| "source": "./src/index.ts", | ||
| "types": "./dist/typescript/commonjs/src/index.d.ts", | ||
| "module": "./dist/module/index.js", | ||
| "default": "./dist/commonjs/index.js" | ||
| }, | ||
| "./package.json": "./package.json" | ||
| }, | ||
@@ -33,12 +36,11 @@ "scripts": { | ||
| "prebuild": "yarn clean", | ||
| "build": "yarn tsc && yarn compile", | ||
| "build": "bob build", | ||
| "prebuild:dev": "yarn clean", | ||
| "build:dev": "yarn tsc && yarn compile:dev", | ||
| "build:dev": "bob build", | ||
| "clean": "rimraf ./dist", | ||
| "lint": "eslint src --ext .ts,.tsx", | ||
| "compile": "NODE_ENV=production rollup -c", | ||
| "compile:dev": "NODE_ENV=development rollup -c", | ||
| "tsc": "tsc", | ||
| "typecheck": "yarn tsc", | ||
| "ci:test": "yarn test --runInBand" | ||
| "typecheck": "tsc --noEmit --emitDeclarationOnly false", | ||
| "ci:test": "yarn test --runInBand", | ||
| "prepare": "bob build" | ||
| }, | ||
@@ -70,10 +72,5 @@ "dependencies": { | ||
| "prettier": "^3.0.3", | ||
| "reactotron-core-client": "2.9.7", | ||
| "react-native-builder-bob": "^0.40.13", | ||
| "reactotron-core-client": "2.9.8", | ||
| "redux": "4.2.1", | ||
| "rollup": "1.1.2", | ||
| "rollup-plugin-babel": "4.3.2", | ||
| "rollup-plugin-babel-minify": "7.0.0", | ||
| "rollup-plugin-filesize": "^6.0.1", | ||
| "rollup-plugin-node-resolve": "4.0.0", | ||
| "rollup-plugin-resolve": "0.0.1-predev.1", | ||
| "ts-jest": "^29.1.1", | ||
@@ -104,3 +101,18 @@ "typescript": "^4.9.5" | ||
| ] | ||
| }, | ||
| "react-native-builder-bob": { | ||
| "source": "src", | ||
| "output": "dist", | ||
| "exclude": "**/*.test.{tsx,ts}", | ||
| "targets": [ | ||
| "commonjs", | ||
| [ | ||
| "module", | ||
| { | ||
| "esm": true | ||
| } | ||
| ], | ||
| "typescript" | ||
| ] | ||
| } | ||
| } |
| import { | ||
| InferFeatures, | ||
| ReactotronCore, | ||
| StateResponsePlugin, | ||
| type InferFeatures, | ||
| type ReactotronCore, | ||
| type StateResponsePlugin, | ||
| assertHasStateResponsePlugin, | ||
@@ -6,0 +6,0 @@ } from "reactotron-core-client" |
| import{assertHasStateResponsePlugin}from"reactotron-core-client";import diff from"microdiff";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread2(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _toPrimitive(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==typeof b?b:b+""}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var stateCleaner=function(a){return a.toJS?a.toJS():a};function pathObject(a,b){if(!a)return b;for(var c,d=a.split("."),e=b,f=0;f<d.length;f++)if(c=d[f],e=e[c],f<d.length-1&&"object"!==_typeof(e)){e=void 0;break}return e}function createSubscriptionHandler(a,b){function c(){if(!a||!a.reduxStore||"function"!=typeof a.reduxStore.getState)return[];var b=a.reduxStore.getState(),c=[];return e.forEach(function(a){var d=a,e=!1;a&&a.endsWith("*")&&(e=!0,d=a.substr(0,a.length-2));var f=pathObject(d,b);e&&d&&f?c.push.apply(c,_toConsumableArray(Object.entries(f).map(function(a){return{path:"".concat(d,".").concat(a[0]),value:a[1]}}))):c.push({path:d,value:f})}),c}function d(){var b=c();0<b.length&&a.stateValuesChange(b)}var e=[];return b(function(){a.reduxStore.subscribe(d)}),{sendSubscriptions:function(){var b=c();a.stateValuesChange(b)},sendSubscriptionsIfNeeded:d,setSubscriptions:function(a){e=a}}}function createCommandHandler(a,b,c){assertHasStateResponsePlugin(a);var d=a,e=createSubscriptionHandler(a,c);return function(a){var c=a.type,f=a.payload,g=d.reduxStore;switch(c){case"state.keys.request":case"state.values.request":{var h=stateCleaner(g.getState());if(!f.path)d.stateKeysResponse(null,"state.keys.request"===c?Object.keys(h):h);else{var i=pathObject(f.path,h),j="state.keys.request"===c?d.stateKeysResponse:d.stateValuesResponse;j(f.path,"state.keys.request"===c?"object"===_typeof(i)?Object.keys(i):void 0:i)}}break;case"state.values.subscribe":e.setSubscriptions(f.paths),e.sendSubscriptions();break;case"state.action.dispatch":g.dispatch(f.action);break;case"state.backup.request":{var k=g.getState();b.onBackup&&(k=b.onBackup(k)),d.send("state.backup.response",{state:k});break}case"state.restore.request":{var l=f.state;b.onRestore&&(l=b.onRestore(f.state,g.getState())),d.reduxStore.dispatch({type:b.restoreActionType,state:l});break}}}}function createSendAction(a){return function(b,c){var d=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2],e=3<arguments.length?arguments[3]:void 0,f=b.type;"symbol"===_typeof(f)&&(f=f.toString().replace(/^Symbol\(/,"").replace(/\)$/,"")),a.send("state.action.complete",{name:f,action:b,ms:c,diff:e},d)}}var DEFAULT_REPLACER_TYPE="REACTOTRON_RESTORE_STATE";function reactotronReducer(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:DEFAULT_REPLACER_TYPE;return function(c,d){var e=d.type===b?d.state:c;return a(e,d)}}function createCustomDispatch(a,b,c){var d=[c.restoreActionType].concat(_toConsumableArray(c.except||[]));return function(e){var f,g=a.startTimer(),h=null===b||void 0===b||null===(f=b.getState)||void 0===f?void 0:f.call(b),i=b.dispatch(e),j=g(),k="PERFORM_ACTION"===e.type&&e.action?e.action:e,l=d.some(function(a){return"string"==typeof a?k.type===a:"function"==typeof a?a(k.type):!!(a instanceof RegExp)&&a.test(k.type)});if(!l){var m,n=!1;c&&"function"==typeof c.isActionImportant&&(n=!!c.isActionImportant(k));var o=null===b||void 0===b||null===(m=b.getState)||void 0===m?void 0:m.call(b);a.reportReduxAction(k,j,n,diff(h,o))}return i}}function createEnhancer(a,b,c){return function(){var d=!!(0<arguments.length&&arguments[0]!==void 0)&&arguments[0];return function(e){return function(f){for(var g=arguments.length,h=Array(1<g?g-1:0),i=1;i<g;i++)h[i-1]=arguments[i];var j=e.apply(void 0,[reactotronReducer(f,b.restoreActionType)].concat(h)),k=_objectSpread2(_objectSpread2({},j),{},{dispatch:createCustomDispatch(a,j,b)});return d||(a.reduxStore=k,c()),k}}}}function reactotronRedux(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=_objectSpread2(_objectSpread2({},a),{},{restoreActionType:a.restoreActionType||DEFAULT_REPLACER_TYPE}),c=[],d=function(a){c.push(a)},e=function(){c.forEach(function(a){a()})};return function(a){return{onCommand:createCommandHandler(a,b,d),features:{createEnhancer:createEnhancer(a,b,e),setReduxStore:function(b){a.reduxStore=b,e()},reportReduxAction:createSendAction(a)}}}}export{reactotronRedux}; |
| "use strict";Object.defineProperty(exports,"__esModule",{value:!0});function _interopDefault(a){return a&&"object"==typeof a&&"default"in a?a["default"]:a}var reactotronCoreClient=require("reactotron-core-client"),diff=_interopDefault(require("microdiff"));function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread2(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}function _toPrimitive(a,b){if("object"!=typeof a||!a)return a;var c=a[Symbol.toPrimitive];if(void 0!==c){var d=c.call(a,b||"default");if("object"!=typeof d)return d;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===b?String:Number)(a)}function _toPropertyKey(a){var b=_toPrimitive(a,"string");return"symbol"==typeof b?b:b+""}function _typeof(a){"@babel/helpers - typeof";return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a},_typeof(a)}function _defineProperty(a,b,c){return b=_toPropertyKey(b),b in a?Object.defineProperty(a,b,{value:c,enumerable:!0,configurable:!0,writable:!0}):a[b]=c,a}function _toConsumableArray(a){return _arrayWithoutHoles(a)||_iterableToArray(a)||_unsupportedIterableToArray(a)||_nonIterableSpread()}function _arrayWithoutHoles(a){if(Array.isArray(a))return _arrayLikeToArray(a)}function _iterableToArray(a){if("undefined"!=typeof Symbol&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}function _unsupportedIterableToArray(a,b){if(a){if("string"==typeof a)return _arrayLikeToArray(a,b);var c=Object.prototype.toString.call(a).slice(8,-1);return"Object"===c&&a.constructor&&(c=a.constructor.name),"Map"===c||"Set"===c?Array.from(a):"Arguments"===c||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(c)?_arrayLikeToArray(a,b):void 0}}function _arrayLikeToArray(a,b){(null==b||b>a.length)&&(b=a.length);for(var c=0,d=Array(b);c<b;c++)d[c]=a[c];return d}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var stateCleaner=function(a){return a.toJS?a.toJS():a};function pathObject(a,b){if(!a)return b;for(var c,d=a.split("."),e=b,f=0;f<d.length;f++)if(c=d[f],e=e[c],f<d.length-1&&"object"!==_typeof(e)){e=void 0;break}return e}function createSubscriptionHandler(a,b){function c(){if(!a||!a.reduxStore||"function"!=typeof a.reduxStore.getState)return[];var b=a.reduxStore.getState(),c=[];return e.forEach(function(a){var d=a,e=!1;a&&a.endsWith("*")&&(e=!0,d=a.substr(0,a.length-2));var f=pathObject(d,b);e&&d&&f?c.push.apply(c,_toConsumableArray(Object.entries(f).map(function(a){return{path:"".concat(d,".").concat(a[0]),value:a[1]}}))):c.push({path:d,value:f})}),c}function d(){var b=c();0<b.length&&a.stateValuesChange(b)}var e=[];return b(function(){a.reduxStore.subscribe(d)}),{sendSubscriptions:function(){var b=c();a.stateValuesChange(b)},sendSubscriptionsIfNeeded:d,setSubscriptions:function(a){e=a}}}function createCommandHandler(a,b,c){reactotronCoreClient.assertHasStateResponsePlugin(a);var d=a,e=createSubscriptionHandler(a,c);return function(a){var c=a.type,f=a.payload,g=d.reduxStore;switch(c){case"state.keys.request":case"state.values.request":{var h=stateCleaner(g.getState());if(!f.path)d.stateKeysResponse(null,"state.keys.request"===c?Object.keys(h):h);else{var i=pathObject(f.path,h),j="state.keys.request"===c?d.stateKeysResponse:d.stateValuesResponse;j(f.path,"state.keys.request"===c?"object"===_typeof(i)?Object.keys(i):void 0:i)}}break;case"state.values.subscribe":e.setSubscriptions(f.paths),e.sendSubscriptions();break;case"state.action.dispatch":g.dispatch(f.action);break;case"state.backup.request":{var k=g.getState();b.onBackup&&(k=b.onBackup(k)),d.send("state.backup.response",{state:k});break}case"state.restore.request":{var l=f.state;b.onRestore&&(l=b.onRestore(f.state,g.getState())),d.reduxStore.dispatch({type:b.restoreActionType,state:l});break}}}}function createSendAction(a){return function(b,c){var d=!!(2<arguments.length&&arguments[2]!==void 0)&&arguments[2],e=3<arguments.length?arguments[3]:void 0,f=b.type;"symbol"===_typeof(f)&&(f=f.toString().replace(/^Symbol\(/,"").replace(/\)$/,"")),a.send("state.action.complete",{name:f,action:b,ms:c,diff:e},d)}}var DEFAULT_REPLACER_TYPE="REACTOTRON_RESTORE_STATE";function reactotronReducer(a){var b=1<arguments.length&&arguments[1]!==void 0?arguments[1]:DEFAULT_REPLACER_TYPE;return function(c,d){var e=d.type===b?d.state:c;return a(e,d)}}function createCustomDispatch(a,b,c){var d=[c.restoreActionType].concat(_toConsumableArray(c.except||[]));return function(e){var f,g=a.startTimer(),h=null===b||void 0===b||null===(f=b.getState)||void 0===f?void 0:f.call(b),i=b.dispatch(e),j=g(),k="PERFORM_ACTION"===e.type&&e.action?e.action:e,l=d.some(function(a){return"string"==typeof a?k.type===a:"function"==typeof a?a(k.type):!!(a instanceof RegExp)&&a.test(k.type)});if(!l){var m,n=!1;c&&"function"==typeof c.isActionImportant&&(n=!!c.isActionImportant(k));var o=null===b||void 0===b||null===(m=b.getState)||void 0===m?void 0:m.call(b);a.reportReduxAction(k,j,n,diff(h,o))}return i}}function createEnhancer(a,b,c){return function(){var d=!!(0<arguments.length&&arguments[0]!==void 0)&&arguments[0];return function(e){return function(f){for(var g=arguments.length,h=Array(1<g?g-1:0),i=1;i<g;i++)h[i-1]=arguments[i];var j=e.apply(void 0,[reactotronReducer(f,b.restoreActionType)].concat(h)),k=_objectSpread2(_objectSpread2({},j),{},{dispatch:createCustomDispatch(a,j,b)});return d||(a.reduxStore=k,c()),k}}}}function reactotronRedux(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:{},b=_objectSpread2(_objectSpread2({},a),{},{restoreActionType:a.restoreActionType||DEFAULT_REPLACER_TYPE}),c=[],d=function(a){c.push(a)},e=function(){c.forEach(function(a){a()})};return function(a){return{onCommand:createCommandHandler(a,b,d),features:{createEnhancer:createEnhancer(a,b,e),setReduxStore:function(b){a.reduxStore=b,e()},reportReduxAction:createSendAction(a)}}}}exports.reactotronRedux=reactotronRedux; |
| import { ReactotronCore } from "reactotron-core-client"; | ||
| import { PluginConfig } from "./pluginConfig"; | ||
| export default function createCommandHandler<Client extends ReactotronCore = ReactotronCore>(reactotron: Client, pluginConfig: PluginConfig, onReduxStoreCreation: (func: () => void) => void): ({ type, payload }: { | ||
| type: string; | ||
| payload?: any; | ||
| }) => void; |
| export {}; |
| import { PluginConfig } from "./pluginConfig"; | ||
| export default function createCustomDispatch(reactotron: any, store: { | ||
| dispatch: Function; | ||
| getState?: Function; | ||
| }, pluginConfig: PluginConfig): (action: any) => any; |
| export {}; |
| import type { ReactotronCore } from "reactotron-core-client"; | ||
| import { PluginConfig } from "./pluginConfig"; | ||
| export default function createEnhancer<Client extends ReactotronCore = ReactotronCore>(reactotron: Client, pluginConfig: PluginConfig, handleStoreCreation: () => void): (skipSettingStore?: boolean) => (createStore: any) => (reducer: any, ...args: any[]) => any; |
| export {}; |
| export default function pathObject(path: string, obj: any): any; |
| export {}; |
| declare const _default: (state: any) => any; | ||
| export default _default; |
| export {}; |
| import type { ReactotronCore } from "reactotron-core-client"; | ||
| import { PluginConfig } from "./pluginConfig"; | ||
| declare function reactotronRedux(pluginConfig?: PluginConfig): <Client extends ReactotronCore = ReactotronCore>(reactotron: Client) => { | ||
| onCommand: ({ type, payload }: { | ||
| type: string; | ||
| payload?: any; | ||
| }) => void; | ||
| features: { | ||
| createEnhancer: (skipSettingStore?: boolean) => (createStore: any) => (reducer: any, ...args: any[]) => any; | ||
| setReduxStore: (store: any) => void; | ||
| reportReduxAction: (action: { | ||
| type: any; | ||
| }, ms: number, important?: boolean, diff?: any) => void; | ||
| }; | ||
| }; | ||
| export type ReactotronReduxPlugin = ReturnType<typeof reactotronRedux>; | ||
| export { reactotronRedux }; |
| export interface PluginConfig { | ||
| restoreActionType?: string; | ||
| onBackup?: (state: any) => any; | ||
| onRestore?: (restoringState: any, reduxState: any) => any; | ||
| except?: (string | Function | RegExp)[]; | ||
| isActionImportant?: (action: any) => boolean; | ||
| } |
| export declare const DEFAULT_REPLACER_TYPE = "REACTOTRON_RESTORE_STATE"; | ||
| export default function reactotronReducer(rootReducer: Function, actionName?: string): (state: any, action: { | ||
| type: string; | ||
| state?: any; | ||
| }) => any; |
| export {}; |
| import type { ReactotronCore } from "reactotron-core-client"; | ||
| export default function createSendAction<Client extends ReactotronCore = ReactotronCore>(reactotron: Client): (action: { | ||
| type: any; | ||
| }, ms: number, important?: boolean, diff?: any) => void; |
| export {}; |
| export default function createSubscriptionHandler(reactotron: any, onReduxStoreCreation: (func: () => void) => void): { | ||
| sendSubscriptions: () => void; | ||
| sendSubscriptionsIfNeeded: () => void; | ||
| setSubscriptions: (subs: string[]) => void; | ||
| }; |
| export {}; |
| import type { InferFeatures, Reactotron } from "reactotron-core-client"; | ||
| import type { ReactotronReduxPlugin } from "."; | ||
| export declare const defaultReactotronMock: Reactotron & InferFeatures<Reactotron, ReactotronReduxPlugin>; |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
122095
74.86%22
-18.52%147
234.09%1928
57.13%0
-100%