Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More Reflex.Time and related functions #184

Open
lspitzner opened this issue Apr 7, 2018 · 2 comments
Open

More Reflex.Time and related functions #184

lspitzner opened this issue Apr 7, 2018 · 2 comments

Comments

@lspitzner
Copy link
Contributor

lspitzner commented Apr 7, 2018

See https://gist.github.com/lspitzner/18e679006765b308e9dbc41b06e86bbb

  • gateGather: an accumulating gate
  • maskCalmE: behaves like throttle, but not controlled by time, but by input dynamic
  • conditionalBuffer: a buffer that can conditionally retain one input event value
  • fanBy: (eventsWhenFalse, eventWhenTrue) = fanBy pred inputE
  • fanOn: (eventsWhenFalse, eventWhenTrue) = fanOn boolBeh inputE
  • triggerDelay: behaves like delay, but not controlled by time, but my a second input event
  • executeAsync1Calm: perform an event asynchronously, but do not run more than one at a time
  • executeAsync1CalmWith: with custom forker function
  • gateThrottle: like throttle but without any accumulation. better for debouncing bursts.

All names open for discussion.

Only gateThrottle actually uses time, so I doubt that Reflex.Time is the right module, but not sure where else these would belong.

@lspitzner
Copy link
Contributor Author

I have added conditionalBuffer because it was necessary to fix the semantics of executeAsync1Calm(With). Preventing logic loops when inputs get connected to outputs is tricky.. hope things are fixed now.

@lspitzner
Copy link
Contributor Author

To be clear, I am ready to turn this into a PR, presuming that there is interest in having these included and that we decide on which module to put these in.

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

No branches or pull requests

4 participants