This project has been succeeded by GraphReFly. New development happens at graphrefly-ts. npm install @graphrefly/graphrefly
Skip to content

rawSubscribe()

Subscribes to a raw callbag source. Calls cb on each DATA (type 1) emission. Returns an object with unsubscribe() to disconnect.

Signature

ts
function rawSubscribe<T = any>(
	source: CallbagSource,
	cb: (value: T) => void,
	opts?: { onEnd?: (error?: unknown) => void },
): { unsubscribe(): void }

Parameters

ParameterTypeDescription
sourceCallbagSourceA raw callbag source function.
cb(value: T) =&gt; voidCalled with each emitted value.
opts{ onEnd?: (error?: unknown) =&gt; void }Optional onEnd when the stream completes or errors.

Returns

{ unsubscribe() } to disconnect from the source.

Released under the MIT License.