UNPKG

@curi/addon-prefetch

Version:

An addon to enable prefetching curi routes

21 lines (12 loc) 1.04 kB
# @curi/addon-prefetch [![npm][badge]][npm-link] [badge]: https://img.shields.io/npm/v/@curi/addon-prefetch.svg [npm-link]: https://npmjs.com/package/@curi/addon-prefetch The prefetch addon enables you to run a `uri`'s `load` function prior to actually navigating to that location. This is only useful for in-app navigation. If the user uses the browser's forward/back buttons, the loading will be handled within the Curi configuration object. **Note:** If you use this addon, then your `load` functions should be caching the data. This is because the route's `load` function is always called when generating a response, effectively making a duplicate call. **Another Note:** This package is experimental and I'm still not convinced that it is necessary. This might be highly modified or even removed in the future. ## Installation ```js npm install --save @curi/addon-prefetch ``` For more information, please check out the [`@curi/addon-prefetch`](https://curi.js.org/packages/@curi/addon-prefetch) page on the documentation website.