0.3.0 • Published 6 years ago

redux-state-observable v0.3.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

redux-state-observable

Build Status Coverage Status Conventional Commits npm david

NPM

A tiny node module which returns the path to a redux state property as an rxjs/observable using object-path.

Installation and Usage

Install via npm and use with typescript

npm i redux-state-observable

To import and use the function:

import { getValue$ } from "redux-state-observables";
const objectPath: string[] = ["object", "property"];
const name$: Observable<TState> = getValue$<TState, TValue>(store, objectPath); // TState represents the state type of the redux store (the type of the root object) while TValue represents the type of the value you want to subscribe to
const nameSubscription: Subscription = name$.subscribe(value =>
  console.log(value)
);
nameSubscription.unsubscribe();

API

The following is the typescript function definiton:

getValue$<TState, TValue = TState>( // Note that TValue is a optional paramter
  store: Store<TState>,
  objectPath: ObjectPathGlobal.IPath = "" // Note that the objectPath is an optional parameter.
): Observable<TValue>
0.3.0

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago