Skip to content

[feat] Support of Signals #124

@motss

Description

@motss

Is your feature request related to a problem? Please describe.
I knew that there is already an existing useProp() and useState() which already do their job just nice. I wonder if Signals is a valid feature to be considered in atomico.

Describe the solution you'd like

import { html, useSignal } from 'atomico';

function MyComponent() {
  const $count = useSignal(0);
  
  return html`
  <host shadowDom>
    <button onclick=${() => $count.value--}>-</button>
    <span>${count.value}</span>
    <button onclick=${() => $count.value++}>+</button>
  </host>
  `;
}

Describe alternatives you've considered
useState() does the same thing already.

Additional context

Prior arts:

  1. Solid's Signals
  2. Preact's Signals
  3. Qwik's Signals

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions