rx-use
v1.8.1
Published
Sensor and side-effect library for [`rxjs`](https://rxjs-dev.firebaseapp.com/). Do you want to contribute? See, [`help wanted`](https://github.com/streamich/rx-use/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22).
Downloads
378
Readme
rx-use
Sensor and side-effect library for rxjs
. Do you want to contribute? See, help wanted
.
Observables
location$
— browser location and history sensor.pathname$
— browser location pathname sensor.
network$
— returns consolidate network status info.onLine$
—boolean
whether user is on-line.connection$
— information about user's network connection.
windowSize$
andwindowSizeRaf$
— browser window dimension sensor.darkTheme$
— emitstrue
if UI should use dark theme.matchMedia$()
— returns boolean indicating media query match.colorSchemeDark$
— whether user selected dark theme in system settings.colorSchemeLight$
— whether user selected light theme in system settings.colorSchemeNoPreference$
— whether user has no preference for color scheme.
stdin$
— listen for data coming from STDIN.ansiKeys$
— listen for ANSI terminal key presses.pubsub
— publish/subscribe mechanism for inter-tab communication in browser.tablist
— keeps track of all same origin tabs, elects leader and allows to send messages to all tabs or create private channels between any two tabs.
Operators
raf()
— de-bounces events usingwindow.requestAnimationFrame
.
Other
fromStream()
— constructs observable from Node.js readable stream.
Most observables imported from this library have ReadonlyBehaviorSubject
type.
Which is an Observable
with an extra .getValue()
to access the current value of the observable.
type ReadonlyBehaviorSubject<T> = Observable<T> & Pick<BehaviorSubject<T>, 'getValue'>;
License
Unlicense — public domain.