SolidJS
@atolljs/solidjs — Signal adapter — the sdk uses solid-js internally for its reactive core, so shared values are natively tracked.
Install
npm install @atolljs/core @atolljs/solidjsUsage
import { createSharedValue, createTask } from '@atolljs/solidjs';
import { counterMemory } from './counter.memory';
import { counter } from './counter';
export function App() {
const count = createSharedValue(counterMemory, 'count');
const increment = createTask(counter.increment);
return (
<button onClick={() => increment.run(1)}>
count: {count() ?? '…'}
</button>
);
}Binding API
| Export | Signature | What it does |
|---|---|---|
createObservable | createObservable(source: ObservableValue<T>): Accessor<T> | Subscribe to any observable snapshot. |
createSharedValue | createSharedValue(memory, key, select?, options?): Accessor<T | undefined> | Bind one shared-memory field to an Accessor; optional selector + equality. |
createTask | createTask(task | asyncFn): { state: Accessor<TaskSnapshot>, run, runOnce } | Bind an AsyncTask — or any async fn — to a signal and get its triggers. |
Live demo
If the frame is blank, the examples aren't up — run npm run dev:all (dev servers) or npm run serve:all (built apps) from the repository root.
Notes
- Subscriptions auto-dispose via onCleanup when the owner is destroyed.
- Worker-hosted Solid trees (islands) live in the companion package @atolljs/solid-island — see the Islands page under this section.