How to use the rxjs-hooks.useObservable function in rxjs-hooks

To help you get started, we’ve selected a few rxjs-hooks examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github bnankiewicz / organic / src / experiments / gestures.tsx View on Github external
function GesturesTwoDimentionsReorder({
  renderItem,
  ...props
}: React.ComponentProps) {
  const value = useObservable(() => interval(500).pipe(map(val => val * 3)))
  /**
   * State
   */
  const [markedRow, setMarkedRow] = useState()
  const [level, setLevel] = useState(0)
  const [ordering, setOrdering] = useState([1, 2, 3, 4, 5])
  const [markerPosition, setMarkerPosition] = useState(0)

  // FIXME position of animated rectangle
  // TODO get rectangle size from focused entry
  const refs = useRef(
    (() => ({
      translateX: new Animated.Value(0),
      translateY: new Animated.Value(0),
      lastOffset: { x: 0, y: 0 },
      lastTouchedItemIndex: null,

rxjs-hooks

React hooks for RxJS

MIT
Latest version published 2 years ago

Package Health Score

56 / 100
Full package analysis