Skip to content

Commit

Permalink
feat(core): remove statusContext API
Browse files Browse the repository at this point in the history
This removes the undocumented `statusContext` API.

This state property was originally added to my POC to track which error happened last in the lifecycle. Since we don't leverage this for now, let's remove it. If users express the need for such a feature, we can add the feature back.
  • Loading branch information
francoischalifour committed Oct 29, 2020
1 parent cb967a4 commit 5d83578
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/autocomplete-core/src/getDefaultProps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ export function getDefaultProps<TItem>(
collections: [],
isOpen: false,
status: 'idle',
statusContext: {},
context: {},
...props.initialState,
},
Expand Down
3 changes: 0 additions & 3 deletions packages/autocomplete-core/src/stateReducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ export const stateReducer: Reducer = (state, action) => {
...state,
query: '',
status: 'idle',
statusContext: {},
collections: [],
};
}
Expand All @@ -95,7 +94,6 @@ export const stateReducer: Reducer = (state, action) => {
selectedItemId: null,
isOpen: false,
status: 'idle',
statusContext: {},
};
}

Expand All @@ -113,7 +111,6 @@ export const stateReducer: Reducer = (state, action) => {
: null,
isOpen: action.props.openOnFocus, // @TODO: Check with UX team if we want to close the menu on reset.
status: 'idle',
statusContext: {},
query: '',
};
}
Expand Down
3 changes: 0 additions & 3 deletions packages/autocomplete-core/src/types/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,5 @@ export interface AutocompleteState<TItem> {
collections: Array<AutocompleteCollection<TItem>>;
isOpen: boolean;
status: 'idle' | 'loading' | 'stalled' | 'error';
statusContext: {
error?: Error;
};
context: { [key: string]: unknown };
}

0 comments on commit 5d83578

Please sign in to comment.