Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOM lifecycle events selection #877

Open
janat08 opened this issue Mar 23, 2019 · 13 comments
Open

DOM lifecycle events selection #877

janat08 opened this issue Mar 23, 2019 · 13 comments

Comments

@janat08
Copy link

janat08 commented Mar 23, 2019

Would be cool of if you could select lifecycle hooks for DOM driver, for if you're using jquery plugins. My solution to this was basically creating global events.

@jvanbruegge
Copy link
Member

Have you looked into snabbom hooks? They allow you to do this

@janat08
Copy link
Author

janat08 commented Mar 23, 2019

That's what I want to select.

@jvanbruegge
Copy link
Member

Hooks just do something, there is nothing you could select, what exactly do you mean?

@janat08
Copy link
Author

janat08 commented Mar 23, 2019

Create a bunch of streams for each node, and once a hook is run produce event for that stream? An update hook is arguably an event.

DOMSource.select('input').hooks('update' ...

@jvanbruegge
Copy link
Member

yeah, an update is an event, but you already get updates with DOMSource.select('input').element(). I don't see the other hooks as events

@janat08
Copy link
Author

janat08 commented Mar 23, 2019

The imperative dom libraries usually emit events with callbacks themselves. While its simply matters of hoisting to convert them into streams and use them in main, but it's uglier. Is it really difficult to plumb through the hooks to dom driver?

@janat08
Copy link
Author

janat08 commented Mar 23, 2019

When I was referring to using global events above, I was referring to chaining onto widget events rather than the hooks.

@jvanbruegge
Copy link
Member

Honestly I still have problems understanding what you want to do in the end

@janat08
Copy link
Author

janat08 commented Apr 5, 2019

You make an instance of widget for example, and that widget emits events for when it does something. What I'm complaining about is that your view function that will contain a bunch of event handlers, as opposed to them being in intents function.

@staltz
Copy link
Member

staltz commented Apr 8, 2019

@janat08 Could you try DOMSource.select('input').element() as jvanbruegge suggested?

@janat08
Copy link
Author

janat08 commented Apr 8, 2019

If that updates a couple of times, it will instantiate several widgets.

@fuunnx
Copy link
Contributor

fuunnx commented Apr 8, 2019

Is #807 related to your question ?

@janat08
Copy link
Author

janat08 commented Apr 12, 2019

No, I want the hooks in dom driver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants