1.0.2 • Published 1 year ago

@romain-faust/use-singleton v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@romain-faust/use-singleton

React hook used to create singleton values.

Installation

With NPM:

npm install @romain-faust/use-singleton

With PNPM:

pnpm add @romain-faust/use-singleton

With Yarn:

yarn add @romain-faust/use-singleton

Dependencies

Usage

import { useSingleton } from '@romain-faust/use-singleton'

const RandomValue = () => {
    const value = useSingleton(() => Math.random())

    return <div>Random value: {value}</div>
}

License

MIT

1.0.2

1 year ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago