UNPKG

reactotron-react-query

Version:
22 lines 1.06 kB
import invalidateReactQueryCommand from "./invalidate-react-query-command"; import { broadcastMutationEvent, broadcastReactQueryEvent } from "./reactotron-helpers"; function reactotronReactQuery(queryClientManager) { return function (reactotron) { queryClientManager.subscribe(function (event) { return broadcastReactQueryEvent(reactotron, event); }, function (event) { return broadcastMutationEvent(reactotron, event); }); reactotron.onCustomCommand(invalidateReactQueryCommand(queryClientManager)); return { onCommand: function (_a) { var type = _a.type, payload = _a.payload; switch (type) { case "state.action.dispatch": if (payload.action.queryHash) { queryClientManager.fetchQueryByHash(payload.action.queryHash); } break; } }, }; }; } export { reactotronReactQuery }; //# sourceMappingURL=reactotron-react-query.js.map