Created
August 10, 2018 09:14
-
-
Save cemremengu/d29b0016a260135cab85096a23d197bc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Papa from 'papaparse'; | |
import { saveAs } from 'file-saver/FileSaver'; | |
export default async ({ payload, filename }) => { | |
saveAs( | |
new Blob([Papa.unparse(payload)], { type: 'text/plain;charset=utf-8' }), | |
`${filename}.csv` | |
); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment