Give every workspace a README describing what it does, its entry points, and a short usage example, and link them from the root package table. Frame Tailshare in the root README as the application the libraries exist to be composed into, with the other apps as development and testing surfaces. Its own README records what works today and what the open issues intend for it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@webnet/tsconnect-redux
Redux Toolkit slice and bindings for @webnet/tsconnect IPN state.
buildIpnStore creates an RTK store combining slices for connection state, peers, exit-node selection, login URL, and inbound/outbound/waiting Taildrop file transfers. runWithStore wires an IPN instance's run() notify callbacks (notifyState, notifyNetMap, notifyIncomingFiles, ...) to dispatch the corresponding actions (setState, setNetmap, setIncomingFiles, ...), and wraps ipn.deleteWaitingFile so it also removes the entry from the store. bindFileOpsToStore mirrors a ControlledFileOps implementation's counters (file count, sizes, limits) into the store on every change. A large set of memoized selectors (getIpnState, getPeers, getWaitingFiles, isIpnLockedOut, getIpnSuggestedExitNode, ...) read from the resulting IpnState. This package has no UI framework dependency — @webnet/tsconnect-react layers React hooks and context on top of it, and @webnet/tsconnect-worker uses it to replicate state from a SharedWorker to its clients.
Entry points
| Entry point | Description |
|---|---|
@webnet/tsconnect-redux |
buildIpnStore, runWithStore, bindFileOpsToStore, slice actions (setState, setNetmap, setExitNode, setLoginUrl, setIncomingFiles, setOutgoingFiles, deleteOutgoingFile, setWaitingFiles, deleteWaitingFile, setFileOpsState), slice selectors (selectIpnState, selectPeers, selectIncomingFiles, selectOutgoingFiles, selectWaitingFiles, selectFileOps), derived selectors (getIpnState, getPeers, getPeerByName, getWaitingFiles, getIncomingFiles, getOutgoingFiles, isIpnLockedOut, getIpnSuggestedExitNode, getLoginUrl, getExitNode, ...), and the IpnState/IpnAction/IpnDispatch/IpnStore/FileOpsState types. |
Usage
import { initIPN } from "@webnet/tsconnect"
import { buildIpnStore, runWithStore, getIpnState, getPeers } from "@webnet/tsconnect-redux"
const store = buildIpnStore()
const buildIpn = await initIPN(wasmBytes)
const ipn = buildIpn({ authKey: process.env.TS_AUTHKEY })
runWithStore(ipn, store)
store.subscribe(() => {
console.log(getIpnState(store.getState()), getPeers(store.getState()))
})
See also
@webnet/tsconnect— theIPNtype whoserun()callbacks feed this store.@webnet/tsconnect-react— React hooks and context built on this store.@webnet/tsconnect-worker— replicates this store's state from aSharedWorkerto its clients.