Created
March 27, 2019 13:53
-
-
Save piurafunk/267b3707b6c49c5ad0bff3088cc87cb0 to your computer and use it in GitHub Desktop.
A factory for FormData objects
This file contains 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
// Wrapper to easily build a FormData object | |
FormData.factory = data => Object.keys(data).reduce((p, k) => {p.set(k, data[k]); return p}, new FormData()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment