thedodd / ybc

A Yew component library based on the Bulma CSS framework.
Apache License 2.0
258 stars 37 forks source link

Should `FileProperties::files` be a `Vec<String>`? #22

Open unbrice opened 3 years ago

unbrice commented 3 years ago

Currently the files property of ybc::FileProperties is a Vec<web_sys::File>. This is slightly inconvenient, because in order to read the file, one need to hand it over eg to a ReaderService, at which point ybc::FileProperties can no longer own it.

Of the whole web_sys::File object, only the name seems in use. If instead of files, ybc::FileProperties contained a file_names: Vec<String>, ownership wouldn't be an issue anymore.

Thus I offer to add a file_names property to ybc::FileProperties. files would stay for compatibility. Its content would appended to the list, after elements from file_names. Does that sound reasonable? If yes, I'll be happy to send you a pull request.