Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // this only half works, it's a demonstration of the idea
- export default (text, filename) => {
- const blob = new Blob([text], { type: "text/plain" });
- const anchor = document.createElement("a");
- anchor.download = filename;
- anchor.href = window.URL.createObjectURL(blob);
- anchor.target = "_blank";
- anchor.style.display = "button";
- return anchor;
- };
Add Comment
Please, Sign In to add comment