News for hackers. Stuff that matters.
Re:Hyperapp – A tiny framework for building web interfaces by _old_dude_ on Wednesday July 01, 2020 @04:16PM (#23706023)
Thanks for taking the time to explain me how it works. So you're right that you can not use a previous state.

And if i want to get the dispatcher directly, i can write a helper function

  function effect(fun) {
    return state => [state, [dispatcher => fun(dispatcher)]]
  }
and use it to access to the dispatcher/updater

  h(
    "button",
    { onclick: effect(updater => setTimeout(() => updater(Decrement), 1000)) },
    "subtract"
  )
Thanks a lot !
Re:Hyperapp – A tiny framework for building web interfaces by jorgebucaran on Wednesday July 01, 2020 @04:20PM (#23706091)
Basically, yes!

In practice, we don't advocate users to reach out for dispatch, as Hyperapp intends to provide all the fx/subscriptions building blocks you need to create the right abstractions and stay within the safe, declarative side of things.

The reality is, though, that crafting these building blocks takes time and thought, so we don't have them all yet. But people in the community have created fx/sub libraries that are already available, see e.g. this one: https://github.com/okwolf/hyperapp-fx that

Cheers!