Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 546 Bytes

README.md

File metadata and controls

33 lines (23 loc) · 546 Bytes

react-download-link

A simple component to download data from a client-side cache (e.g. flux, redux).

Design to be used with browserify or webpack.

Install with:

npm install --save react-download-link

Include with:

import DownloadLink from 'react-download-link'

Use:

<DownloadLink
	filename="myfile.txt"
	label="Save to disk"
	exportFile={() => "My cached data"} />

Or with Promises:

<DownloadLink
	filename="myfile.txt"
	label="Save to disk"
	exportFile={() => Promise.resolve("My cached data")} />