use-promise-memo
v1.0.0
Published
```tsx import { usePromiseMemo } from 'use-promise-memo'
Downloads
2
Readme
use-promise-memo
import { usePromiseMemo } from 'use-promise-memo'
function App(){
const promise = usePromiseMemo(() => {
return new Promise(resolve => setTimeout(resolve, 3000))
}, [])
return (
<View>
<Text>
{promise.pending
? 'Loading...'
: promise.rejected
? promise.result.message
: 'Done'}
</Text>
</View>
)
}