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 HtmlTag#withSelf, restore debounce example #155

Merged
merged 2 commits into from
Jan 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/time.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ app.renderInto(node.asInstanceOf[fs2.dom.Node[IO]]).allocated.unsafeRunAndForget

## Debounce

```scala
```scala mdoc:js
import calico.*
import calico.html.io.{*, given}
import calico.syntax.*
Expand All @@ -89,7 +89,7 @@ val app = Channel.unbounded[IO, String].toResource.flatMap { emailCh =>
div(
span(
label("Your email: "),
input { self =>
input { (self: fs2.dom.HtmlInputElement[IO]) => // FIXME compiler bug
onInput --> (_.evalMap(_ => self.value.get).through(emailCh.sendAll))
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is extremely annoying. Another workaround is to do:

input { self =>
  Tuple1(onInput --> (_.evalMap(_ => self.value.get).through(emailCh.sendAll)))
}

I'm going to try and minimize and report a compiler bug.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}
),
Expand Down