Skip to content

Add useAsync hook to leverage new Hooks proposal #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Dec 30, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Use latest React version with hooks.
  • Loading branch information
ghengeveld committed Dec 30, 2018
commit 73e6cb2e11a1bc981fa9be7bc120c33ff887e14f
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"test:backwards": "npm i react@16.3.1 react-dom@16.3.1 && npm test",
"test:forwards": "npm i react@next react-dom@next && npm test",
"test:latest": "npm i react@latest react-dom@latest && npm test",
"test:hook": "npm i react@16.7.0-alpha.0 react-dom@16.7.0-alpha.0 && jest src/useAsync.spec.js --collectCoverageFrom=src/useAsync.js",
"test:hook": "npm i react@16.7.0-alpha.2 react-dom@16.7.0-alpha.2 && jest src/useAsync.spec.js --collectCoverageFrom=src/useAsync.js",
"prepublishOnly": "npm run lint && npm run test:compat && npm run test:hook && npm run build"
},
"dependencies": {},
Expand Down
2 changes: 1 addition & 1 deletion src/useAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const useAsync = (opts, init) => {

const unsupported = () => {
throw new Error(
"useAsync requires react@16.7.0 or later. Upgrade your React version or use the <Async> component instead."
"useAsync requires react@16.7.0-alpha. Upgrade your React version or use the <Async> component instead."
)
}

Expand Down