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

@brightleaf/react-hooks

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@brightleaf/react-hooks - npm Package Compare versions

Comparing version 0.4.1 to 0.5.0

lib/use-local-storage.js

16

lib/index.js

@@ -30,2 +30,8 @@ "use strict";

});
Object.defineProperty(exports, "useLocalStorage", {
enumerable: true,
get: function () {
return _useLocalStorage.default;
}
});
Object.defineProperty(exports, "useNes", {

@@ -43,2 +49,8 @@ enumerable: true,

});
Object.defineProperty(exports, "usePut", {
enumerable: true,
get: function () {
return _usePut.default;
}
});
Object.defineProperty(exports, "useWebSockets", {

@@ -59,2 +71,4 @@ enumerable: true,

var _useLocalStorage = _interopRequireDefault(require("./use-local-storage"));
var _useNes = _interopRequireDefault(require("./use-nes"));

@@ -64,4 +78,6 @@

var _usePut = _interopRequireDefault(require("./use-put"));
var _useWebsockets = _interopRequireDefault(require("./use-websockets"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

1

lib/use-post.js

@@ -20,3 +20,2 @@ "use strict";

const postData = async data => {
console.info('post data');
dispatch({

@@ -23,0 +22,0 @@ type: 'get'

{
"name": "@brightleaf/react-hooks",
"version": "0.4.1",
"version": "0.5.0",
"description": "Useful react hooks",

@@ -5,0 +5,0 @@ "files": [

@@ -12,2 +12,3 @@ # Brightleaf React Hooks

* `useWebSockets` - Hook to interact with WebSockets
* `useLocalStorage` - Hook to local storage

@@ -228,1 +229,20 @@ ## GraphQL Hook

## Local Storage Hook
```javascript
import React, { useRef } from 'react'
import { useLocalStorage } from '@brightleaf/react-hooks'
export default () => {
const [count, setCount] = useLocalStorage(0);
return (
<div>
<p>You clicked {count} times</p>
<button onClick={() => setCount(count + 1)}>
Click me
</button>
</div>
);
}
```
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