effector-solid
TypeScript icon, indicating that this package has built-in type declarations

0.23.0 • Public • Published

effector-solid

SolidJS bindings for effector

Installation

npm install --save effector effector-solid

Or using yarn

yarn add effector effector-solid

Or using pnpm

pnpm add effector effector-solid

Usage

import {createStore, combine, createEvent} from 'effector'

import {useUnit} from 'effector-solid'

const inputText = createEvent()

const $text = createStore('').on(inputText, (_, text) => text)

const $size = createStore(0).on(inputText, (_, text) => text.length)

const Form = () => {
  const {
    text,
    size
  } = useUnit({
    size: $size,
    text: $text
  })

  return (
    <form>
      <input
        type="text"
        onInput={e => inputText(e.currentTarget.value)}
        value={text()}
      />
      <p>Length: {size}</p>
    </form>
  )
}

Dependents (1)

Package Sidebar

Install

npm i effector-solid

Homepage

effector.dev

Weekly Downloads

851

Version

0.23.0

License

MIT

Unpacked Size

163 kB

Total Files

18

Last publish

Collaborators

  • drevoed
  • drelliot
  • sergeysova
  • lobatik
  • zero_bias