3rd party plugins
jmas opened this issue · 1 comments
Problem
We know how React components is working - and there we have places (componentDidMount()
, componentWillUnmount()
) where we can link 3rd party plugins (ex. jQuery plugins). But in diffhtml I do not see a quick approach how to detect element mounting or unmounting.
Possible solution
Pass to createElement()
callbacks like onMount
, onUnmount
as options. So in those callbacks we can easily do workaround about create or destroy some 3rd party plugins. Also method onUpdate
where we can refresh plugins state by for ex. reading data-
attributes or pass all attributes to this function.
Or if you have better solution: please give an example. Maybe I'm wrong and we do not need to use React-like style to interact with diffhtml.
Thanks.
You could use: https://github.com/tbranyen/diffhtml-inline-transitions and pass callbacks to attached
and detached
.