# @atlassian/terminal-dispatch-state

> A simple library for building dynamic terminal interfaces

Latest version **0.0.2** (published 2019-09-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @atlassian/terminal-dispatch-state
pnpm add @atlassian/terminal-dispatch-state
yarn add @atlassian/terminal-dispatch-state
bun add @atlassian/terminal-dispatch-state
```

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2019-09-27 |
| First published | 2019-09-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | ^12 |
| Dependencies | 1 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Dmitrii Sorin |
| Maintainers | 1999-atlassian, atlassian_fabric_elements, atlassian-aui, cdarroch, cwhittington, dboyd, dmorrow, doklovic, dwalker, jonycheung.atlassian, jvdl, macku, mdejongh, mstaas, mszczepanski, prkb, shnooshnoo |
| Keywords | react, redux, terminal, cli, cli state |

## Links

- npm: https://www.npmjs.com/package/@atlassian/terminal-dispatch-state
- Repository: https://github.com/1999/terminal-dispatch-state
- Homepage: https://github.com/1999/terminal-dispatch-state#readme
- Issues: https://github.com/1999/terminal-dispatch-state/issues
- npm.io page: https://npm.io/package/@atlassian/terminal-dispatch-state

## Dependencies (1)

- [cli-cursor](https://npm.io/package/cli-cursor.md) ^3.1.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.0.2 (latest) — 2019-09-27
- 0.0.1 — 2019-09-19

## README

## terminal-dispatch-state

Build dynamic terminal interfaces by updating the state.

![](./examples/demo.svg)

## API

```javascript
import { Store } from '@atlassian/terminal-dispatch-state';
import ora from 'ora'; // if you want to show a spinner

const store = new Store();
const state = [
  'line1',
  'line2',
  'line3',
];

store.update(state); // renders three lines in the terminal

state.push('line4');
store.update(state); // does not render anything because state is the same object

const newState = [...state];
store.update(newState); // adds one line

const spinner = ora('Loading unicorns');
const newStateWithUnicorns = [
  ...newState,
  { spinner, isRunning: true }
]
store.update([...newState, progress]); // adds ora spinner with text

store.stop();
```

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