Named parameters and Typescript
Description
Thanks to @dnim for updating the lib to TS and refactoring the function to take named parameters for a simpler developer experience when working when specifying customized behavior.
Breaking Changes
- Named parameters are now required for passing custom
data
,filename
, anddelimeter
props. - Support for the IE
navigator.msSaveBlob
method was removed from the code (as it was removed in new versions of TypeScript). - File name can be provided without
.csv
extension, it will be added automatically
Migration Steps
- update to the new version (2.x)
- map arguments on object props. I.e:
const props = {
data: data,
filename: filename,
delimiter: delimiter
}
csvDownload(props);