Skip to content

Commit

Permalink
docs: improve context typing
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Apr 23, 2024
1 parent e1d28ad commit 213ccc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/components/Farmhand/Farmhand.context.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
*/
import { createContext } from 'react'

// eslint-disable-next-line no-unused-vars
import uiEventHandlers from '../../handlers/ui-events'

/**
* @type {import('react').Context<{
* gameState: farmhand.state & {
Expand All @@ -20,7 +23,7 @@ import { createContext } from 'react'
* viewList: string[],
* viewTitle: string,
* }
* handlers: Record<string, (...any) => void>
* handlers: uiEventHandlers
* }>}
*/
// @ts-expect-error
Expand Down
4 changes: 1 addition & 3 deletions src/components/FermentationRecipeList/FermentationRecipe.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@ const getRecipesInstancesInCellar = memoize(
export const FermentationRecipe = ({ item }) => {
const {
gameState: { inventory, cellarInventory, purchasedCellar },
handlers: {
/** @type {function(item, number)} */ handleMakeFermentationRecipeClick,
},
handlers: { handleMakeFermentationRecipeClick },
} = useContext(FarmhandContext)

const [quantity, setQuantity] = useState(1)
Expand Down

0 comments on commit 213ccc5

Please sign in to comment.