Skip to content

Commit

Permalink
feat(action): added isActionAbortError helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcourtice committed Feb 7, 2022
1 parent cbadf59 commit ba62d3a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions extensions/action/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,10 @@ export default function actionsExtension<TState extends BaseState>() {
}));
}

function isActionAbortError(value: unknown) {
return value instanceof ActionAbortError;
}

function resetActionState(name?: string | string[]) {
const names = ([] as string[]).concat(name || Object.keys(_store.state[STATE_PROP]));

Expand Down Expand Up @@ -258,6 +262,7 @@ export default function actionsExtension<TState extends BaseState>() {
whenActionIdle,
hasActionFailed,
getActionErrors,
isActionAbortError,
resetActionState,
abortAction,
onBeforeAction,
Expand Down
2 changes: 1 addition & 1 deletion plugins/devtools/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function getInspectorEditHook(application: App, stores: InternalStores): EditHoo
};
}

function getMutationHook(api: DevtoolsPluginApi, logType?: LogType): EventHandler {
function getMutationHook(api: DevtoolsPluginApi<unknown>, logType?: LogType): EventHandler {
return payload => {
if (!payload) {
return;
Expand Down

0 comments on commit ba62d3a

Please sign in to comment.