Nocturnal Programmer's Machine

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

    0.22.7 • 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>
      )
    }

    Install

    npm i effector-solid

    Homepage

    effector.dev

    DownloadsWeekly Downloads

    327

    Version

    0.22.7

    License

    MIT

    Unpacked Size

    156 kB

    Total Files

    18

    Last publish

    Collaborators

    • drevoed
    • drelliot
    • sergeysova
    • lobatik
    • zero_bias