Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@lani.ground/react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@lani.ground/react-hooks - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

4

package.json
{
"name": "@lani.ground/react-hooks",
"description": "react hooks",
"version": "0.2.0",
"version": "0.2.1",
"keywords": [

@@ -73,3 +73,3 @@ "react-hooks",

},
"gitHead": "b2aeb4574a02c6eca7305d89fcaafdc1f53b835a"
"gitHead": "e0b77484de036a9e7ac80eb1433442b7485a1c3b"
}

@@ -38,3 +38,2 @@ # react-hooks

## useWindowScroll

@@ -62,1 +61,44 @@

```
## useCookie
### usage
``` tsx
import { useCookies } from '@lani.ground/react-hooks';
import { useEffect } from 'react';
export default function Hooks() {
const { getCookie, setCookie, hasCookie, deleteCookie } = useCookies();
const setTestCookie = () => {
const day = new Date();
day.setMinutes(day.getMinutes() + 1);
setCookie('test', 'true', { expires: 'today' });
};
const checkCookie = () => {
const hasTest = hasCookie('test');
console.log('hasTest', hasTest); // true | false
};
useEffect(() => {
const testCookie = getCookie('test');
console.log('testCookie', testCookie); // true | false
}, []);
return (
<>
<button type="button" onClick={() => checkCookie()}>
Check Cookie
</button>
<button type="button" onClick={() => setTestCookie()}>
Set Cookie
</button>
<button type="button" onClick={() => deleteCookie('test')}>
Delete Cookie
</button>
</>
);
}
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc