jdanyow / blog-comments

Repo containing comments on my blog
https://danyow.net
MIT License
3 stars 0 forks source link

binding-to-file-inputs-with-aurelia/ #13

Open utterances-bot opened 6 years ago

utterances-bot commented 6 years ago

Binding to file inputs with Aurelia

https://www.danyow.net/binding-to-file-inputs-with-aurelia/

deap82 commented 6 years ago

This is relly cool, nice post! Stumbled upon this; the https://developer.mozilla.org/en-US/docs/Web/API/URL/revokeObjectURL Do you have some idea how this could be managed with regards to the BlobToUrlValueConverters? AFAIK, value converters doesn't have an unbind/detached awareness, so one would need some mechanism to keep track of what files had URLs created...

jdanyow commented 6 years ago

That's a great point. Instead of using a value converter we could use a binding behavior. This would give us access to the bind/unbind lifecycle events. Here's how to do that:

https://gist.run/?id=baf4431d2f9e2d878101e6082380fb22