Created
March 7, 2023 10:43
-
-
Save stuff/646a25e8c777c35293d33a3d6a2b9f44 to your computer and use it in GitHub Desktop.
pseudo code recherche
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getIngredients } from './../../data/recipesData.js'; | |
const mainSearch = 'gateau'; | |
const selectedAppliance = 'casserole'; | |
const selectedUstensils = ['couteau', 'casserole']; | |
const selectedIngredients = ['pomme', 'chocolat']; | |
const recipies = { | |
/* */ | |
}; | |
function filterRecipes(query, queryOpptions) { | |
} | |
filterRecipes(''); | |
filterRecipes('', { appliance: 'casserole' }); | |
filterRecipes('', { | |
appliance: 'casserole', | |
ingredients: ['pomme', 'chocolat'], | |
}); | |
function filterIngredients(query) { | |
} | |
filterIngredients(''); // | |
filterIngredients('coc'); // | |
onclick(ingredient) { | |
selectedIngredients.push(ingredient); | |
buildMainResults() | |
buildIngredients(); | |
} | |
function buildMainResults(){ | |
// const mainSearch = 'gateau'; | |
// const selectedAppliance = 'casserole'; | |
// const selectedUstensils = ['couteau', 'casserole']; | |
// const selectedIngredients = ['pomme', 'chocolat']; | |
const results = filterRecipes(mainSearch, { ingredients: selectedIngredients}); | |
} | |
// expect(filterIngredients('coc')).toEqual(['Coco']); | |
// expect(filterIngredients('c')).toEqual(['Coco', 'Chocolat', 'Creme']); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment