@liveflux/core
v0.1.0
Published
Framework-agnostic core engine — connection lifecycle, subscriptions, store, and backpressure.
Maintainers
Readme
@liveflux/core
The framework-agnostic core engine of Liveflux — connection lifecycle, multiplexed subscriptions, folded state store, and backpressure. Type-safe, cache-integrated, and reconnect-safe realtime streaming state for the frontend.
It owns a single multiplexed connection and drives a pluggable transport StreamAdapter; pair it
with one of the adapters below.
Install
pnpm add @liveflux/core
# plus a transport adapter, e.g.
pnpm add @liveflux/ws # any plain WebSocket backend
pnpm add @liveflux/phoenix # Elixir Phoenix ChannelsFramework bindings build on top:
pnpm add @liveflux/react # the useStream hookUsage
import { LivefluxClient } from '@liveflux/core';
import { ws } from '@liveflux/ws';
const client = new LivefluxClient({
adapter: ws('wss://api.example.com/socket'),
});
client.connect();
const sub = client.subscribe({ channel: 'orders', into: { strategy: 'append' } });
sub.subscribe((orders) => console.log(orders));See the full documentation at liveflux.bpdm.dev.
License
MIT © Bhavin Devamorari
