timgilbert / cljs-pikaday

A ClojureScript interface to the Pikaday javascript date-picker
MIT License
52 stars 9 forks source link

Do cleanup in :component-will-unmount #2

Closed viesti closed 9 years ago

viesti commented 9 years ago

Adds :component-will-unmount, which clears watches and calls Pikaday.destroy.

I actually used this to make cljs-pikaday reload i18n by using a React key bound to selected locale (so that React recreates the component on locale change). Might be neat to have ability to change i18n data on the fly (like the date-atom), but didn't spend too much time on finding a neat way and this solution allows to export the decision for reloading pikaday opts to external code :)

timgilbert commented 9 years ago

Looks nice, thanks!

timgilbert commented 9 years ago

Published this PR as version 0.1.2.

viesti commented 9 years ago

Super! Thanks for the fast response :)