@dapp-builder/use-realtime-value
TypeScript icon, indicating that this package has built-in type declarations

0.2.1 • Public • Published

⟠ use-realtime-value ⟠

A library to get realtime value

Installation

npm install @dapp-builder/use-realtime-value
yarn add @dapp-builder/use-realtime-value

Example

import { useEffect, useState } from "react";
import useInfiniteData from "use-infinite-data";

const ExampleComponent = () => {
  const [value, setValue] = useState(0) 
  const valueInstance = useRealtimeValue(value)

  useEffect(()=> {
    cosnt listener = () => {
      // console.log new value
      console.log(valueInstance.getValue());
    }

    // listen event
  }, [])

};

Package Sidebar

Install

npm i @dapp-builder/use-realtime-value

Weekly Downloads

1

Version

0.2.1

License

ISC

Unpacked Size

1.9 kB

Total Files

4

Last publish

Collaborators

  • ngduythao
  • nhatminh0509