Hyperapp: Lifecycle events in V2

Created on 30 Jul 2018  路  4Comments  路  Source: jorgebucaran/hyperapp

What about using popular libraries? I think that it is a real use case. For example standard jQuery datepicker.

I've created an example with the datepicker and hyperapp1 with oncreate event
https://jsfiddle.net/badgoto/tfoxqd6h

How can I achive this in hyperapp2 ?

Thanks.

Inquiry

Most helpful comment

@dmitrykurmanov detecting when an element is added to the dom, and doing something with it, is possible through the MutationObserver api. So it's still technically possible even if Hyperapp removes lifecycle events.

Having said that, it can easily get very complicated. After having played with MutationObserver a bit I've become an even bigger fan of the lifecycle-events we currently have. They're just so convenient.

All 4 comments

@dmitrykurmanov I eventually want to remove lifecycle events from Hyperapp, but I'm most likely going to keep them for HAV2.

See also: #717

@jorgebucaran I am sorry. I've missed #717

@dmitrykurmanov detecting when an element is added to the dom, and doing something with it, is possible through the MutationObserver api. So it's still technically possible even if Hyperapp removes lifecycle events.

Having said that, it can easily get very complicated. After having played with MutationObserver a bit I've become an even bigger fan of the lifecycle-events we currently have. They're just so convenient.

@zaceno Thanks, MutationObserver api is interesting variant, I didn't think about it.

PS this issue is duplicate of #717 I've moved my question there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SkaterDad picture SkaterDad  路  3Comments

icylace picture icylace  路  3Comments

Mytrill picture Mytrill  路  4Comments

rbiggs picture rbiggs  路  4Comments

zhaotoday picture zhaotoday  路  3Comments