# usegstate

> react library for creating global states in most easy way

Latest version **1.0.1** (published 2023-02-22) · MIT license · 0 weekly downloads

## Install

```sh
npm install usegstate
pnpm add usegstate
yarn add usegstate
bun add usegstate
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2023-02-22 |
| First published | 2023-02-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 0 |
| Unpacked size | 18.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | amit231 |
| Maintainers | amit_sharma |

## Links

- npm: https://www.npmjs.com/package/usegstate
- Repository: https://github.com/amit231/usegstate
- Homepage: https://github.com/amit231/usegstate#readme
- Issues: https://github.com/amit231/usegstate/issues
- npm.io page: https://npm.io/package/usegstate

## Recent versions

- 1.0.1 (latest) — 2023-02-22
- 1.0.0 — 2023-02-22

## README

# usegstate

> The simplest way to create Global States.

[![NPM](https://img.shields.io/npm/v/usegstate.svg)](https://www.npmjs.com/package/usegstate) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)

## Install

```bash
npm install --save usegstate
```

## Usage

### Create Global State

```tsx
import { gState } from 'usegstate'

const myGlobalState = gState('hello-world!')

```

### Use Global State

```tsx
import useGState from 'usegstate'

const GenderGetter = () => {
  const [gState,setGState] = useGState(myGlobalState)
  return (
    <div>{gState}</div>
  )
}
```

### Don't forget to wrap your app inside GStateProvider


```tsx
import {GStateProvider} from 'usegstate'

const Wrapper = () => {
  return (
    <GStateProvider>
      <YourWonderfullApp />
    </GStateProvider>
  )
}

```

## License

MIT © [amit231](https://github.com/amit231)

---
_Source: https://npm.io/package/usegstate · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
