janus icon indicating copy to clipboard operation
janus copied to clipboard

[stdlib] Add bridge from Varying to various other common abstractions

Open issa-tseng opened this issue 8 years ago • 1 comments

eg: Varying.asPromise(v).succeedIf(f).failureIf(f) -> Promise

Promises, Rx Observable, anything else that's popular and semantically harmonious enough can be considered. Probably rely on peerDependencies or dependency injection to keep our own dependencies at a minimum.

As detailed in this discussion: https://github.com/socrata-platform/janus/pull/2#discussion_r90362349

issa-tseng avatar Dec 01 '16 01:12 issa-tseng

janus-stdlib now provides fromEvent(jqInstance, eventName, f) which gives a Varying where given an f: (event, …) -> value will map event firings into values for the Varying. It's implemented via Varying.managed, which means the resource lifecycle of the event listener is correctly handled and nothing happens unless the Varying is actually reacted against.

issa-tseng avatar Jun 29 '17 22:06 issa-tseng