Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add FileUploadReactHooks #242

Conversation

pete-murphy
Copy link
Collaborator

Partially addresses #157

@pete-murphy pete-murphy marked this pull request as ready for review September 24, 2020 22:34
Just fileInput -> do
maybeFiles <- (HTMLInputElement.files fileInput)
for_ maybeFiles
(FileList.items >>> map File.name >>> setFileList)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this compile? If so, it gets rid of that case statement.

handleChange t =
  for_ (HtmlInputElement.fromEventTarget t) \fileInput -> do
    maybeFiles <- (HTMLInputElement.files fileInput)
    for_ maybeFiles (setFileList <<< map File.name <<< FileList.items)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉 It does, and I like it 👍 678f287

@JordanMartinez
Copy link
Owner

I'm guessing this is ready to merge once CI passes, correct?

@pete-murphy
Copy link
Collaborator Author

pete-murphy commented Sep 25, 2020

I'm guessing this is ready to merge once CI passes, correct?

Yes, I've tested that it works as expected & I'm happy with the code 👍

@JordanMartinez JordanMartinez merged commit a6f5f9a into JordanMartinez:master Sep 25, 2020
@JordanMartinez
Copy link
Owner

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants