open-index/open-npm huggingface dataset:
npm package: @phntms/react-toolkit
Description: Collection of React hooks and helpers
Author: John Chipps-Harding
Latest version: 0.0.1

# react-toolkit

[![NPM version][npm-image]][npm-url]
[![Actions Status][ci-image]][ci-url]
[![PR Welcome][npm-downloads-image]][npm-downloads-url]

A collection of commonly used React hooks and helpers.

## Introduction

This package is a tool for us to collect useful React hooks and helpers that we come across during project development. As we build on this, we should have a collection of well-tested production ready tools, that can be used to reduce unnecessary duplicate development.

## Contributing

Please see our [CONTRIBUTING guide](./CONTRIBUTING.md) for instructions on how best to add to this repo.

## Installation

Install this package with `npm`.

```bash
npm i @phntms/react-toolkit
```

## Usage

Import your required hooks and use them directly, as seen below:

```tsx
import React from "react";
import { useIdle } from "@phntms/react-toolkit";

const idle = useIdle(200);
```

[npm-image]: https://img.shields.io/npm/v/@phntms/react-toolkit.svg?style=flat-square&logo=react
[npm-url]: https://npmjs.org/package/@phntms/react-toolkit
[npm-downloads-image]: https://img.shields.io/npm/dm/@phntms/react-toolkit.svg
[npm-downloads-url]: https://npmcharts.com/compare/@phntms/react-toolkit?minimal=true
[ci-image]: https://github.com/phantomstudios/react-toolkit/workflows/test/badge.svg
[ci-url]: https://github.com/phantomstudios/react-toolkit/actions
npm package: @phntms/use-key
Description: A simple React hook for listening to custom keyboard events.
Author: Paulo Ferreira Jorge
Latest version: 1.0.0

# use-key

[![NPM version][npm-image]][npm-url]
[![Actions Status][ci-image]][ci-url]
[![PR Welcome][npm-downloads-image]][npm-downloads-url]

A simple React hook for listening to custom keyboard events. This hook is also SSR safe and does not break when used without `window` existing.

## Installation

Install this package with `npm`.

```bash
npm i @phntms/use-key
```

## Usage

To listen to a single key:

```jsx
import useKey from "@phntms/use-key";

useKey("Escape", (pressed: boolean) => {
  if (pressed) // Do something on "Escape"...
});
```

To listen to key modifiers:

```jsx
import useKey from "@phntms/use-key";

useKey("g", (pressed: boolean, event: KeyboardEvent) => {
  if (pressed && event.ctrlKey) // Do something on "Ctrl + G"...
});
```

## API

The hook uses [KeyboardEvent](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key) under the hood. This means using the `onChange` event, you can get the state of modifier keys such as Shift as well as the keyboard locale and layout.

## Contributing

Want to get involved, or found an issue? Please contribute using the GitHub Flow. Create a branch, add commits, and open a Pull Request or submit a new issue.

Please read `CONTRIBUTING` for details on our `CODE_OF_CONDUCT`, and the process for submitting pull requests to us!

[npm-image]: https://img.shields.io/npm/v/@phntms/use-key.svg?style=flat-square&logo=react
[npm-url]: https://npmjs.org/package/@phntms/use-key
[npm-downloads-image]: https://img.shields.io/npm/dm/@phntms/use-key.svg
[npm-downloads-url]: https://npmcharts.com/compare/@phntms/use-key?minimal=true
[ci-image]: https://github.com/phantomstudios/use-key/workflows/test/badge.svg
[ci-url]: https://github.com/phantomstudios/use-key/actions
npm package: @pho-nomenal/5-minute-github-demo
Description: Functions for working with the Fibonacci sequence and things
Author: GitHubber
Latest version: 21.5.1

| Linux | Windows | MacOS|
|-------|-------|-------|
| ![Node.js Package](https://github.com/pho-nomenal/5-minute-github-demo/workflows/Node.js%20Package/badge.svg)  | ![Node.js Package](https://github.com/pho-nomenal/5-minute-github-demo/workflows/Node.js%20Package/badge.svg) | ![Node.js Package](https://github.com/pho-nomenal/5-minute-github-demo/workflows/Node.js%20Package/badge.svg) |
# fib-tools - Demo2021

https://www.npmjs.com/~pho-nomenal James

``` - run: npm publish --access public ```

## Get the nth Number

```javascript
const {getNumber} = require('@bbq-beets/fib-tools')
assert.strictEqual(getNumber(8), 21)
```

## Get a List of Numbers

```javascript
const {getList} = require('@bbq-beets/fib-tools')
assert.strictDeepEqual(getList(8), [0, 1, 1, 2, 3, 5, 8, 13, 21])
```

## Get a Sequence of Numbers   

```javascript   
const {getSequence} = require('@bbq-beets/fib-tools')

const seq = getSequence()

for (const n of seq) {
  console.log(n) // The next Fibonacci number in the sequence
}
```