JSPM

  • Created
  • Published
  • Downloads 38324
  • Score
    100M100P100Q147086F
  • License MIT

React hooks for RxJS Observables with powerful APIs.

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.

mindmap

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] with useObservableState.
    • Call props function with useObservablePropsCallback.
    • Easily combine or chain Observables together to deal with complex scenarios.
  • Testing
    • useObservable will not trigger an extra rerender on init.
    • useObservableState will not trigger an extra rerender with startWith.
    • useSubscription will unsubscribe on unmount.