open-index/open-npm huggingface dataset:
npm package: @higorkonig/pix-js
Description: <!-- PROJECT LOGO --> <br /> <p align="center">   <a href="https://github.com/higorkonig/pix-code-js">     <img src="https://logodownload.org/wp-content/uploads/2020/02/pix-bc-logo-1.png" alt="Logo" width="215" height="76">   </a> </p>
Author: Higor Konig
Latest version: 2.0.1

<!-- PROJECT LOGO -->
<br />
<p align="center">
  <a href="https://github.com/higorkonig/pix-code-js">
    <img src="https://logodownload.org/wp-content/uploads/2020/02/pix-bc-logo-1.png" alt="Logo" width="215" height="76">
  </a>
</p>


**Esse pacote está funcionando, porém será descontinuado em breve, novo repositório: <br>[`manda-o-pix`](https://www.npmjs.com/package/manda-o-pix)**
npm package: @higoshi/global-state
Description: * A global state management module for React. * Eliminates the need for `Context` and `Provider`.
Latest version: 0.0.8

# global-state

* A global state management module for React.
* Eliminates the need for `Context` and `Provider`.


## Usage

**useTodoList.ts**
```useTodoList.ts
import {useGlobalState} from '@higoshi/global-state';

const symbol = Symbol('TodoList');

export const useTodoList = () => {
  return useGlobalState<string[]>(symbol, []);
};

```

**page.tsx**
```page.tsx
'use client';
import React from 'react';
import {useTodoList} from './useTodoList';

export default function() {
  const [todoList, setTodoList] = useTodoList();

  const clickHandler = () => {
    setTodoList(oldTodoList => {
      return [...oldTodoList, Math.random() + ''];
    });
  };

  return (
    <>
      <ul>
        {todoList.map((todo, index) => {
          return <li key={index}>{todo}</li>;
        })}
      </ul>
      <button onClick={clickHandler}>Add</button>
    </>
  );
};
```