paf31 / purescript-behaviors

A simple push-pull FRP implementation
MIT License
133 stars 22 forks source link

Event.Mouse#move is incorrect? #45

Closed safareli closed 5 years ago

safareli commented 5 years ago

While I was reading code of this lib, I came to this possible bug:

As in withPosition in resulting event is made using subscribtion of event passed to it https://github.com/paf31/purescript-behaviors/blob/3e300f9023ed85c6ff8d2b9840d69fba9604e7a4/src/FRP/Event/Mouse.purs#L85-L94

Here in move because pure unit is passed as event, there is no way for it to detect mouse moves (i haven't tested it but there seems to be no way for it to actually work): https://github.com/paf31/purescript-behaviors/blob/3e300f9023ed85c6ff8d2b9840d69fba9604e7a4/src/FRP/Event/Mouse.purs#L61-L63

paf31 commented 5 years ago

This is by design, it's meant for constructing behaviors (which should only fire as often as necessary, and no more).