@swear-js/react
Advanced tools
Comparing version 1.1.1 to 1.1.5
{ | ||
"name": "@swear-js/react", | ||
"version": "1.1.1", | ||
"version": "1.1.5", | ||
"description": "React support for swear-js", | ||
@@ -9,3 +9,2 @@ "repository": { | ||
}, | ||
"private": false, | ||
"keywords": [ | ||
@@ -30,6 +29,6 @@ "state-manager", | ||
"compile": "npm run clean && tsc --outDir lib -p src -d", | ||
"release": "npm run compile && npm run standard-version && git push --follow-tags origin main && npm publish --access public" | ||
"release": "npm run compile && npm publish --access public" | ||
}, | ||
"dependencies": { | ||
"@swear-js/core": "^1.1.0", | ||
"@swear-js/core": "^1.1.5", | ||
"@types/node": "^17.0.24", | ||
@@ -52,3 +51,4 @@ "@types/react": "^18.0.5", | ||
"standard-version": "^9.3.1" | ||
} | ||
}, | ||
"gitHead": "36bab69b6c2702996aadf90012baec0982d37df7" | ||
} |
@@ -58,1 +58,20 @@ # 🍭 Swear JS | ||
``` | ||
Use your swear via hook | ||
```javascript | ||
// YourComponent.jsx | ||
import React from 'react'; | ||
import { countSwear } from './countSwear'; | ||
export const YourComponent = () => { | ||
const [count, { set: setCount, clear: clearCount }] = useSwear(countSwear); | ||
return ( | ||
<> | ||
<span>{count}</span> | ||
<Button onClick={() => setCount(count + 1)}>Increase</Button> | ||
<Button onClick={clearCount}>Reset</Button> | ||
</> | ||
); | ||
} | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
77
3227
2
0
1
Updated@swear-js/core@^1.1.5