Skip to content

Menu item and options query optimization #203

@AndrewLester

Description

@AndrewLester

Making requests for the menu items and options on both the menu and cart pages of the site is unnecessary in sveltekit's SPA structure. Instead, let's make a request for the menu items and options inside the __layout file of routes directory, which will only run once when the user loads either the cart or menu pages. When the user switches between the two, this file won't run.

To get the data from the __layout file into the actual pages (menu and cart), you can either use Svelte's context API or a store. I recommend a store in this case.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions