@epikodelabs/streamix / dom/src/public-api / on
Function: on()
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Call Signature
on(
type):Readable<number>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:36
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"animationFrame"
Returns
Readable<number>
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type):Readable<BatteryState>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:37
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"battery"
Returns
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type):Readable<boolean>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:38
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"fullscreen"
Returns
Readable<boolean>
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type,options?):Readable<GeolocationState>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:39
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"geolocation"
options?
PositionOptions
Returns
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type,timeout?):Readable<IdleDeadline>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:40
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"idle"
timeout?
number
Returns
Readable<IdleDeadline>
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type,element,options?):Readable<boolean>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:41
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"intersection"
element
Element
options?
IntersectionObserverInit
Returns
Readable<boolean>
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type,query):Readable<boolean>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:46
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"mediaQuery"
query
string
Returns
Readable<boolean>
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type,element,options?):Readable<MutationRecord[]>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:47
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"mutation"
element
Element
options?
MutationObserverInit
Returns
Readable<MutationRecord[]>
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type):Readable<NetworkState>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:52
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"network"
Returns
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type):Readable<"portrait"|"landscape">
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:53
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"orientation"
Returns
Readable<"portrait" | "landscape">
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type,target?):Readable<PointerPosition>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:54
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"pointer"
target?
EventTarget
Returns
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type,target?):Readable<ScrollPosition>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:55
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"scroll"
target?
Element | Document | Window
Returns
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type,element):Readable<{width:number;height:number; }>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:56
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"resize"
element
HTMLElement
Returns
Readable<{ width: number; height: number; }>
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type):Readable<ViewportState>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:60
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"viewportChange"
Returns
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);Call Signature
on(
type):Readable<DocumentVisibilityState>
Defined in: projects/libraries/streamix/dom/src/lib/factories/on.ts:61
Creates a reactive stream for a DOM or browser event source.
on is a single entry point that dispatches to the appropriate DOM adapter based on the requested source type.
Parameters
type
"visibilityChange"
Returns
Readable<DocumentVisibilityState>
Example
const pointer = on('pointer');
const scroll = on('scroll', element);
const location = on('geolocation', { maximumAge: 30_000 });
const battery = on('battery');
const matches = on('mediaQuery', '(min-width: 600px)');
const resized = on('resize', element);