@dapp-builder/use-realtime-value
v0.2.1
Published
A library to get realtime value
Downloads
7
Readme
⟠ 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
}, [])
};