@monetaur/hooks
v1.1.4
Published
A collection of useful React hooks
Downloads
2
Readme
hooks
A collection of useful React hooks
Install
npm install @monetaur/hooks
Implement
import React from 'react';
import { useDeepState } from '@monetaur/hooks';
export default function LoginButton() {
const [{ isLoading, value }, update] = useDeepState({
isLoading: false,
value: undefined
});
useEffect(() => {
update('isLoading', true);
}, [update]);
return (
<div>{isLoading ? 'Loading' : 'Not Loading'}</div>
);
}
Continuous Integration
This package uses GitHub Actions. When a pull request is created, the codebase will automatically be checked for linter errors and test failures.
Releases
This package uses semantic-release
. By default, the package expects commits to follow the Angular Commit Message Conventions. That means that commits intended to trigger a new release should look like these:
Logged Non-Release Commits
- docs: Add documentation for useLocalStorage
- docs(useLocalStorage): Add documentation for useLocalStorage
- style: Change indentation from 4 to 2 spaces
- style(spaces): Change indentation from 4 to 2 spaces
- refactor: Clean up Webpack config file
- refactor(webpack config): Clean up Webpack config file
- perf: Replace react-helmet to resolve memory issues
- perf(react-helmet): Replace react-helmet to resolve memory issues
- test: Add tests for Page component
- test(Page): Add tests for Page component
- chore: 1.0.0
- chore(release): 1.0.0
Minor/Feature Release Commits
- feat: Add useAnotherOne hook for DJ Khaled quotes
- feat(useAnotherOne): Add useAnotherOne hook for DJ Khaled quotes
Patch Release Commits
- fix: Resolve equality issue in useDeepState
- fix(useDeepState): Resolve equality issue in useDeepState
Major/Breaking Release Commits
- BREAKING CHANGE: Button props have changed to align with ever-changing style guide
Continuous Delivery
When a commit is pushed to the master branch, the following steps will occur:
- Run linters and tests
- Run build
- Read version from package.json
- Run
semantic-release
command - Read version from package.json
- If version changed, create a release PR
version-bump/{VERSION}
with the updated version number - Auto approve the release PR after CI processes complete
- Auto merge the release PR