Skip to content
A tiny node module which returns the path to a redux state property as an rxjs/observable using object-path.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
dist
lib
test
.gitignore
.npmignore
.travis.yml
CHANGELOG.md
LICENSE
README.md
_config.yml
cover.tsconfig.json
package-lock.json
package.json
tsconfig.json

README.md

redux-state-observable

Build Status Coverage Status Conventional Commits npm david Known Vulnerabilities

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>
You can’t perform that action at this time.