UNPKG

@thepassle/app-tools

Version:

Collection of tools I regularly use to build apps. Maybe they're useful to somebody else. Maybe not. Most of these are thin wrappers around native API's, like the native `<dialog>` element, `fetch` API, and `URLPattern`.

13 lines 314 B
/** * @param {<Data>(context: import('../index.js').Context) => Promise<Data>} promise * @returns {import('../index.js').Plugin} */ export function data(promise){ return { name: 'data', beforeNavigation: async (context) => { const data = promise(context); context.data = data; } } }