@romain-faust/use-singleton
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

@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

Readme

Keywords

none

Package Sidebar

Install

npm i @romain-faust/use-singleton

Weekly Downloads

1

Version

1.0.2

License

MIT

Unpacked Size

4.37 kB

Total Files

8

Last publish

Collaborators

  • romain-faust