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

Add tap maybe #19

Closed
wants to merge 3 commits into from
Closed

Add tap maybe #19

wants to merge 3 commits into from

Conversation

olle
Copy link
Contributor

@olle olle commented Nov 22, 2019

So I've just put in the most simple thing I could think of, which would offer the tap API that I use and like.

It's really not much, but perhaps you could chime in and tell me what you think.

Some strange things though, I'll try to start a discussion in the code, the test I wrote failed for the example with rawConnector() - and I would like to understand why.

* Tapping a connector, or the `tap` function, is a syntactic sugar
  feature, that wraps the chaining call to `connect` on the signal
  provided by a `connector` when calling `connect`.

  The given `tapFn` will then be applied with the signals next and
  previous value - which conveniently is provided the other way
  around from the signal function (which is applied with id, prev,
  and then next).

  This is aimed at being a very useful and simple way to _tap_ into
  some signal state that is being changed. Often this technique can
  be used in conjuction with effects, or triggers, to build
  behaviour not just with connectors and events, but also by
  _listening_ to maintained signal state - such as the `db` - in
  independent modules.
@olle olle closed this Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants