sharkdp / purescript-flare

A special-purpose UI library for Purescript
286 stars 17 forks source link

add flareWith #19

Closed rintcius closed 8 years ago

rintcius commented 8 years ago

Hi @sharkdp, first of all thanks for this great library!

I have added a flareWith function which enables hooking Flares without running the signal. It is just a slightly more generic version of runFlareWith (and is now written in terms of flareWith).

I'd be happy to know your thoughts about this PR.

sharkdp commented 8 years ago

Thank you very much for the PR!

I'll review this in more detail next week, when I am back home, but looks good to me so far!

Could give an example for when this might be useful?

rintcius commented 8 years ago

Ok, great!

I need it to integrate with non Flare components that expect Signal parameters. E.g given:

myNumberFlare :: forall e.UI e Number
myComponent :: Signal Number -> Eff _ Unit

I can then use it like this (myComponent reacting to changes in myNumberFlare):

main = do
  flareWith "controls" myComponent myNumberFlare
rintcius commented 8 years ago

@sharkdp Updated and tested

sharkdp commented 8 years ago

Thanks! I've released a new version.

rintcius commented 8 years ago

Great, thanks you!