pepsighan / ruukh-ui

An experimental next-gen frontend framework for the Web in Rust.
MIT License
0 stars 1 forks source link

Standalone component setters #19

Closed pepsighan closed 6 years ago

pepsighan commented 6 years ago

Closes #12.

This PR allows the following code to mutate state within closures.

let setter = self.state_setter();

let closure = Box::new(move || {
  setter.set_state(|state| {
    // mutate the state
  });
});