How to use the @sanity/react-hooks.useObservable function in @sanity/react-hooks

To help you get started, we’ve selected a few @sanity/react-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 sanity-io / sanity / packages / test-studio / src / actions / WrappedAction.js View on Github external
export default createAction(props => {
  return useObservable(
    timer(0, 1000).pipe(
      map(n => ({
        label: n % 2 === 0 ? 'Tick' : 'Tack'
      }))
    )
  )
})
github sanity-io / sanity / packages / test-studio / src / actions / ObservableAction.js View on Github external
export default createAction(function ObservableAction(docInfo) {
  return useObservable(
    timer(0, 1000).pipe(
      map(n => ({
        label: n % 2 === 0 ? 'Tick' : 'Tack'
      }))
    )
  )
})

@sanity/react-hooks

Officially supported Sanity Studio API building blocks

MIT
Latest version published 9 months ago

Package Health Score

88 / 100
Full package analysis