r-use-cache
v0.1.1
Published
```js import React from 'react' import { render } from 'react-dom' import useCache from 'r-use-cache'
Downloads
2
Readme
useCache
import React from 'react'
import { render } from 'react-dom'
import useCache from 'r-use-cache'
const App = () => {
const value = useCache(() => {
console.log('Compute only once')
return 42
}, [])
return <div>{value}</div>
}
render(<App />, document.getElementById('root'))