Closed izaid closed 8 years ago
Nice! :) Can we make hasstate
a special case of hasstates
and then rename hasstates
to hasstate
? Basically the new hasstate
will take a dict of 1 element.
@shashi Done. I would consider deprecating hasstate
in an upcoming release.
much better. Yes, that would be nice.
This PR adds two new things to Escher.jl.
The first is a slight reworking of
hasstate
, leading to the new functionhasstates
. The functionhasstates
is similar tohasstate
, but takes aDict
of attribute / event pairs as input and watches all of them. This allows for more complex observations.The second is a new keyword
immediate
onslider
. If this is set totrue
, theslider
will watch both thevalue
and theimmediateValue
properties usinghasstates
. This allows the signal to be updated immediately while the user drags the slider. The default value ofimmediate
isfalse
.This PR effectively solves https://github.com/shashi/Escher.jl/issues/147. All one has to do now is
slider(r, immediate=true)
.This PR is ready for review / merging.