Package Exports
- observable-hooks
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (observable-hooks) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
observable-hooks
React hooks for RxJS Observables with powerful APIs.
Read the doc here.
This project is still in its early stage. Use with caution. PRs are welcome.
TODO
- Examples
- Create an Observable from props and states with
useObservable
. - Create an Observable from event callback with
useObservableCallback
. - Subscribe Observable with
useSubscription
. -
useState
-like[state, setState]
withuseObservableState
. - Call props function with
useObservablePropsCallback
. - Easily combine or chain Observables together to deal with complex scenarios.
- Create an Observable from props and states with
- Testing
-
useObservable
will not trigger an extra rerender on init. -
useObservableState
will not trigger an extra rerender withstartWith
. -
useSubscription
will unsubscribe on unmount.
-