react-wildcat-prefetch
A React higher order component to prefetch component data.
Installation
npm:
npm install react-wildcat-prefetch
Usage
@prefetch({string}|{function} action, [{Object} options])
// Prefetch data from a fully qualified URL@ // Or pass in a function { return Promise;}@ // By default the key name is `asyncData`, but you// can set your own key name in the options object@
Prefetching Data
Full example can be found in the examples folder
; @Component static propTypes = asyncData: PropTypesobjectisRequired ; static defaultProps = asyncData: data: ; { const asyncData: data = thisprops; console; }