Skip to content

Conversation

@gordonbrander
Copy link
Contributor

@gordonbrander gordonbrander commented Jun 7, 2024

Introduces watch async directive to watch a common-frp signal within an HTML template.

import { signal } from '@commontools/common-frp'

const text = signal.state('Hello world')
html`<div>${watch(text)}</div>`
text.send('Henlo world')

TODO

  • Set up basic watch directive
  • Handle detach and reattach lifecycle events

Introduces watch async directive to watch a common-frp signal within an
HTML template.
@gordonbrander gordonbrander requested a review from bfollington June 7, 2024 22:40
...we'll need to think more carefully about how this should work in the
world where Signals are not automatically cleaned up.
...this is the common case, as with computed.
Copy link
Contributor

@bfollington bfollington left a comment

Choose a reason for hiding this comment

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

LGTM

@gordonbrander gordonbrander merged commit ea5e385 into main Jun 8, 2024
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.

3 participants