@atomous/solid
v0.1.2
Published
This package provides a function to convert an atom to a readable signal that can be used in SolidJS components.
Readme
@atomous/solid
This package provides a function to convert an atom to a readable signal that can be used in SolidJS components.
Installation
Use your favorite package manager or a 3rd-party tool to import the library in browser.
npm i @atomous/solid<script src="https://cdn.jsdelivr.net/npm/@atomous/solid"></script>import atomous from 'https://esm.run/@atomous/solid'Usage
import { fromAtom } from '@atomous/solid'
import { atom } from 'atomous'
const $count = atom(0)
export function Counter() {
const count = fromAtom($count)
function increment() {
$count.update(count => count + 1)
}
return <button type="button" onClick={increment}>Count is {count()}</button>
}