@swear-js/react
Advanced tools
Comparing version 1.1.1 to 1.2.0
{ | ||
"name": "@swear-js/react", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"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.4", | ||
"@types/node": "^17.0.24", | ||
@@ -52,3 +51,4 @@ "@types/react": "^18.0.5", | ||
"standard-version": "^9.3.1" | ||
} | ||
}, | ||
"gitHead": "179a2c450b96aa4ec20ae0f4a29af1ba2724968e" | ||
} |
@@ -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.4