@lpsci/hooks
v1.1.1
Published
A highly performant and extensible react hooks for LPSci Web Dev
Downloads
18
Maintainers
Readme
@lpsci/hooks
A highly performant and extensible react hooks for LPSci Web Dev
Table of Contents
Installation
This library is available through the npm registry.
NPM
$ npm -i @lpsci/hooks
Yarn
$ yarn add @lpsci/hooks
Import
Start using it by importing the library first.
CommonJS
const hooks = require('@lpsci/hooks');
ES6
import { useCounter } from '@lpsci/hooks';
Usage
Create a counter with useCounter
import { useCounter } from '@lpsci/hooks';
/**
* Set initial value to 5, defaults to 0 when a
* value is not passed
*/
const counter = useCounter(5)
/**
* Increments the counter state by 10, defaults to 1 when
* a value is not passed
*/
counter.increment(10)
counter.count // => 15
Read the docs for more.
Authors
Here is the list of contributors who participated in this project.