Search Docs
Just like state and decorate, derive allows you to customize Context based on existing Context as Context.store.
Context
Context.store
This is useful when you need to create a value based on an existing value reactively.
app .state("version", 1) .decorate("getDate", () => Date.now()) .derive(({ request: { headers }, store, getDate }) => { return { authorization: headers.get("Authorization"), }; }) .get("/version", ({ authorization }) => authorization);