Closed ltfschoen closed 1 year ago
Per discussion in #56 Signal::set
is fixed in #64.
I don't necessarily want to change the hello_world
from what it is right now, definitely don't want to add a bunch of debug logs to it either. I'll probably work on a new basic example with stateful and event handling that will be front-and-center in the README for 0.7 release.
Example of using the
get
function implementation ofHook
https://docs.rs/kobold/latest/kobold/stateful/struct.Hook.html#method.get, which states "Get the value of state if state implements Copy", where I've used a state that is just a structState
that has amy_state
property with abool
type so it can implement theCopy
trait, since if theState
has properties of types that don't automatically implement theCopy
trait (i.e.Vec
,String
,Range
,Box
) then you get errors like:But if i try to use
stateful::Signal
public function.set
https://docs.rs/kobold/latest/kobold/stateful/struct.Signal.html#method.set, which says it's used to "Replace the entire state with a new value and trigger an update.", it doesn't change the state at all as expected, i thought it would have set themy_state
value totrue