react-useasync-hooks
Advanced tools
Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "react-useasync-hooks", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "React useasync timeout utils", | ||
@@ -35,3 +35,3 @@ "scripts": { | ||
}, | ||
"homepage": "https://github.com/dustinest/typescript-async-utils#readme", | ||
"homepage": "https://github.com/dustinest/typescript-async-utils/tree/main/react-useasync-hooks#readme", | ||
"devDependencies": { | ||
@@ -38,0 +38,0 @@ "@testing-library/jest-dom": "^5.16.3", |
@@ -66,3 +66,3 @@ # Install | ||
/** call some asynchronous code which returs MyType **/ | ||
}, {useInit: true} // by default it is set to false | ||
}, {useInit: true} // optional parameter, by default it is set to false | ||
, [some_depenencies]) | ||
@@ -73,3 +73,3 @@ ``` | ||
The status is either: | ||
- init (`status.type === AsyncStatus.INIT`) // only in case useInit is set to trie (by default, when props are not set it is set to false) | ||
- init (`status.type === AsyncStatus.INIT`) // only in case useInit is set to true (by default, when props are not set it is set to false) fails back to `AsyncStatus.WORKING` when `useInit` is set to false | ||
- init (`status.type === AsyncStatus.WORKING`) // when the callback is working | ||
@@ -76,0 +76,0 @@ - init (`status.type === AsyncStatus.SUCCESS`) // when callback has finished working |
102431