Solid Primitives
Bindings for the community packages published under @solid-primitives. Each page lists the bound signatures; for usage, read the upstream documentation for the package, which the bindings follow closely.
@solid-primitives depends on Solid 1.x, so none of these packages work with Partas.Solid 3.0 on Solid 2 until they are ported upstream and here. That is why these pages have no live examples.
Packages
| Page | Package |
|---|---|
| Active Element | @solid-primitives/active-element |
| Autofocus | @solid-primitives/autofocus |
| Bounds | @solid-primitives/bounds |
| Broadcast Channel | @solid-primitives/broadcast-channel |
| Clipboard | @solid-primitives/clipboard |
| Devices | @solid-primitives/devices |
| Event Bus | @solid-primitives/event-bus |
| Event Listener | @solid-primitives/event-listener |
| Idle | @solid-primitives/idle |
| Input Mask | @solid-primitives/input-mask |
| JSX Tokenizer | @solid-primitives/jsx-tokenizer |
| Keyboard | @solid-primitives/keyboard |
| Media | @solid-primitives/media |
| Mouse | @solid-primitives/mouse |
| Permission | @solid-primitives/permission |
| RAF | @solid-primitives/raf |
| Rootless | @solid-primitives/rootless |
| Scheduled | @solid-primitives/scheduled |
| Scroll | @solid-primitives/scroll |
| Spring | @solid-primitives/spring |
| Storage | @solid-primitives/storage |
| Timer | @solid-primitives/timer |
| Trigger | @solid-primitives/trigger |
| Tween | @solid-primitives/tween |
| WebSocket | @solid-primitives/websocket (not bound) |
Package organisation
Each primitive is its own NuGet package, such as Partas.Solid.Primitives.Mouse, and all of them share the namespace Partas.Solid.Primitives and a dependency on Partas.Solid.Primitives.Common. (Before 0.2.0, each primitive had its own namespace.)
Femto
Each primitive package can be installed with Femto, which also adds its npm dependency:
femto install Partas.Solid.Primitives.Mouse
Use, make and create
The bindings keep the @solid-primitives naming scheme:
makeprimitives are not reactive, but they clean up their resources when their owner is disposed.useprimitives are usually rootless: there is one instance of the primitive, shared by every consumer.createprimitives are reactive, and clean up their resources when their owner is disposed.
Disposal callbacks
Some primitives return a DisposeCallback, a unit -> unit function that cleans up the resource. Call it when you need to release the resource before its owner is disposed.
DisposeCallback comes from Partas.Solid.Primitives.Common. Core Partas.Solid 3.0 has its own DisposalFunc type, which is what createRoot passes to its callback.
