A tiny node module which returns the path to a redux state property as an rxjs/observable using object-path.
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();
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>