MCPcopy
hub / github.com/graphql/graphiql / push

Function push

packages/graphiql-plugin-doc-explorer/src/context.tsx:88–96  ·  view source on GitHub ↗
(item: ExplorerNavStackItem)

Source from the content-addressed store, hash-verified

86
87 const push = // eslint-disable-line react-hooks/exhaustive-deps -- false positive, variable is optimized by react-compiler, no need to wrap with useCallback
88 (item: ExplorerNavStackItem) => {
89 setNavStack(currentState => {
90 const lastItem = currentState.at(-1)!;
91 return lastItem.def === item.def
92 ? // Avoid pushing duplicate items
93 currentState
94 : [...currentState, item];
95 });
96 };
97
98 const pop = () => {
99 setNavStack(currentState =>

Callers 1

ExplorerContextProviderFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected