0.1.3 • Published 2 years ago

gastore-plugin-solid v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Gastore plugin Solid

GastoreSolidJS Signal の統合プラグイン

必須ライブラリ

使い方

npm などでgastore-plugin-solidをインストールしてください。

使用例

import { createStore } from 'gastore'
import { createSignal } from 'solid-js'
import { integrate } from 'gastore-plugin-solid'

export const App = () => { // SolidJS Component
  const store = createStore('')
  const [getSignal, setSignal] = createSignal('')

  integrate(store, [getSignal, setSignal])

  store.set("Hello Gastore!")

  console.log(getSignal()) // ->Hello Gastore!

  setSignal("Hello SolidJS!")

  console.log(store.get()) // ->Hello SolidJS!!

  return (
    // ...
  )
}

integrate()

引数で受け取ったGastore の Store と SolidJS の Signal の内容を統合します。第一引数には Store、第二引数には Signal を指定します。

integrate<T>(store: Store<T>, signal: Signal<T>): void

開発

必要要件

インストール

git clone https://github.com/souhait0614/gastore-plugin-solid
cd gastore-plugin-solid
pnpm i
0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago