Preparing search index...

    Function useMenu

    • Provides reactive menu data and all menu/purchase operations.

      clearMenu also drops purchased ingredient state: the database prunes the purchase flags of ingredients that leave the shopping list on every menu mutation, and clearing the menu empties it entirely.

      Returns {
          menu: menuTableElement[];
          decodeError: Error | null;
          addRecipeToMenu: (recipe: recipeTableElement) => Promise<void>;
          getRecipeById: (recipeId: number) => recipeTableElement | null;
          toggleMenuItemCooked: (menuId: number) => Promise<boolean>;
          removeFromMenu: (menuId: number) => Promise<boolean>;
          clearMenu: () => Promise<void>;
          isRecipeInMenu: (recipeId: number) => boolean;
          togglePurchased: (ingredientName: string) => Promise<void>;
          clearPurchased: () => Promise<void>;
      }

      Object containing reactive menu array, decodeError (see RecipeDatabase.get_decode_error), and all menu mutation functions