These are chat archives for pozadi/kefir

30th
Sep 2015
Erik Ferguson
@muraiki
Sep 30 2015 13:52
hrm, is there a way to use event delegation with fromEvents()?
I guess I can manually filter off of event.target.id, but it'd be nice if fromEvents() supported an additional selector argument like jquery's $('#some-ul').on('click', '#some-li', () => ...)
Roman Pominov
@rpominov
Sep 30 2015 14:59
fromEvents isn't specific for DOM events, it works with any target that supports one of methods pair: on/of, addEventListener/removeEventListener, etc.
so it can't accept some stuff specific for DOM events as additional argument
Erik Ferguson
@muraiki
Sep 30 2015 15:00
I understand; it was simple for me to write a utility function that did what i needed though :) thanks!
Roman Pominov
@rpominov
Sep 30 2015 15:01
just was going to recommend writing a helper function :) :+1:
Erik Ferguson
@muraiki
Sep 30 2015 16:26
darn. getting an input element to work with event delegation is pretty tricky. I can't .toProperty($("#element").value) because #element doesn't exist yet. I suppose I can merge an obs that essentially emits when the element is visible (such as if the user has clicked a tab in the UI that displays the element) but I was hoping to avoid that.
unfortunately the soft deadline for my project has turned into a hard deadline, so I think I'll have to revert to using what I know instead of kefir :(