From 9e73d1c90be5a690542a75892e9292aa6959a778 Mon Sep 17 00:00:00 2001 From: Justin Campbell Date: Wed, 14 Apr 2021 19:15:53 -0400 Subject: [PATCH] Remove old ItemProvider docs --- src/components/ItemProvider/ItemProvider.md | 41 --------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/components/ItemProvider/ItemProvider.md diff --git a/src/components/ItemProvider/ItemProvider.md b/src/components/ItemProvider/ItemProvider.md deleted file mode 100644 index 4653d82..0000000 --- a/src/components/ItemProvider/ItemProvider.md +++ /dev/null @@ -1,41 +0,0 @@ -Utility component that uses [React Contexts](https://reactjs.org/docs/context.html) [React Stateful Variables](https://reactjs.org/docs/hooks-state.html) to provide global access to the active item object. - -Two functions are exported: - -Function | Descrioption -- | - -`useItem` | Returns a reference to the state variable holding the current Item. Defaults to `false`. -`useItemSetter` | Returns a reference to the state variable update function. - -For an in depth explanation of this pattern, see [this GitHub comment](https://github.itap.purdue.edu/ECN/webqueue2/issues/15#issuecomment-341). - - -## Usage -```jsx static -// App - - - -``` - -```jsx static -// SomeComponent -import { useEffect } from "react"; -import { useItem, useItemSetter } from "ItemProvider"; - -const activeItem = useItem(); -const setActiveItem = useItemSetter(); - -useEffect( - let item = someFuncToGetItem(); - setActiveItem(item); -); - -return( - { - item - ?

{`${activeItem.queue} ${activeItem.number} was last updated ${activeItem.lastUpdated}.`}

- :

No item is currently loaded.

- } -); -``` \ No newline at end of file