ppp

parcel-plugin-prefetch

Write some JSON to prefetch data in bundle.

Showing:

Popularity

Downloads/wk

1

Maintenance

No Maintenance Data Available

Package

Dependencies

3

Size (min+gzip)

19.2KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

parcel-plugin-prefetch

Write some JSON to prefetch data in bundle.

How to use

yarn add parcel-plugin-prefetch

  1. Create JSON file with extension .jsonpf
  2. JSON should be a list in the format...
[{
  "key": "foo",
  "url": "https://..."
}]
  1. Add import {foo, STATES} from "./data.jsonpf" to the top of file.
  2. yarn parcel index.html or whatever you use.
  3. Parcel will prefetch the data and return data in below format.
{
  foo: {
    key: "foo",
    url: "https://...",
    state: "FETCHING" // FAILED || FETCHED
    data: {} // Data returned if "FETCHED"
    error: Error // Error returned if "FAILED"  
  },
  // States for comparison.
  STATES: { 
    FETCHING: "FETCHING",
    FETCHED: "FETCHED",
    FAILURE: "FAILURE"
  }
}

Missing data?

Try running with --no-cache.

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100