@jeremyckahn/farmhand
Version:
A farming game
17 lines (14 loc) • 360 B
JavaScript
import { recipesMap } from '../../data/maps.js'
/**
* @param {farmhand.state} state
* @returns {farmhand.state}
*/
export const updateLearnedRecipes = state => ({
...state,
learnedRecipes: Object.keys(recipesMap).reduce((acc, recipeId) => {
if (recipesMap[recipeId].condition(state)) {
acc[recipeId] = true
}
return acc
}, {}),
})