Skip to content

Composing calls to runhandler #10

Description

@FrigoEU

Hey,

I've been using optic-ui for a small project and so far really liking it. I have a lot to learn in terms of how to build reusable components with all the facilities that both purescript and optic-ui offer, but one thing I keep running into is the fact that I can't do two runhandler invocations one after another.

I'm taking some cues from Elm by making a "handle" function that I pass down in the hierarchy and feed "commands" that then changes the state of a higher lying component. However I often want to do two things in response to an event: update the state of the current component AND call the handle function that got passed down. When I want to do it with simple do syntax like this:

do 
  runHandler h $ set _foo "bar"
  handle MyCommand

This doesn't work because of the gen counter in OpticUI.Run. I would make a PR if I had an idea how to fix this, but I don't... Any help much appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions