0.1.1 • Published 1 year ago
@launchscout/live-signals v0.1.1
live-signals
This is a very teeny library to create signals that connect to a LiveState channel.
Usage
createPreactSignal(liveStateOrOptions)
returns a preact signal bound the LiveState state, and a dispatchEvent function which will dispatch a CustomEvent to liveStatecreatePolyfillSignal(liveStateOrOptions)
returns a TC39 polyfill signal bound the LiveState state, , and a dispatchEvent function which will dispatch a CustomEvent to liveStateBoth take either a
LiveState
instance or options which will be used as the arg to create a LiveState instance.Example
See preact-example.html for a small example that uses preact signals. It is designed to connect to the silly_crm example project. You'll need to have that up and running first for it to work.