Issue #15 · Compositional Signals
- 2020 editor
- issue
Subscribing to a portion of a product type stored in a signal should be possible - this may require a refactor, or another additional module, added to the zeta library. This addition would allow for visual components to subscribe to only "pieces" of some whole data, without the excessive other data being supplied to arguments. Something like this: type Mono = Signal {foo :: Foo, bar :: Bar} type Poly = {fooSig :: Signal Foo, barSig :: Signal Bar} -- Mono == Poly get :: Poly -> {foo :: Foo, bar :: Bar} get {fooSig, barSig} = do foo Effect Unit) -> Poly -> Effect Unit subscribe handler {fooSig, barSig} = do let fooChanged foo = do bar <- get barSig handler {foo, bar} barChanged bar = do foo <- get fooSig handler {foo, bar} subscribe fooChanged fooSig subscribe barChanged barSig *Archived by the Wayback Machine on 15 September 2020; the repository has since been deleted from GitHub.*