# ts-elmish

> > The Elm architecture for TypeScript.

Latest version **0.0.2** (published 2018-12-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install ts-elmish
pnpm add ts-elmish
yarn add ts-elmish
bun add ts-elmish
```

## Health

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

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2018-12-10 |
| First published | 2018-12-10 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=6.0.0 |
| Dependencies | 0 |
| Unpacked size | 15.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Ronald Dijks |
| Maintainers | ronalddijks |

## Links

- npm: https://www.npmjs.com/package/ts-elmish
- npm.io page: https://npm.io/package/ts-elmish

## Recent versions

- 0.0.2 (latest) — 2018-12-10
- 0.0.1 — 2018-12-10
- 0.0.0 — 2018-12-10

## README

# ts-elmish

> The Elm architecture for TypeScript.

A lightweight general purpose Elm-like runtime for TypeScript, based off of raj.

```sh
yarn add ts-elmish
```

## Example

A counter that increments by one every thimne the user confirms.

```ts
import { Runtime } from '../src/ts-elmish'

new Runtime({
  init: [0],
  update: (message, state) => {
    return [state + 1]
  },
  view: (state, dispatch) => {
    const keepCounting = window.confirm(`Count is ${state}. Increment?`)
    if (keepCounting) {
      dispatch({})
    }
  }
})
```

_Note:_ ts-elmish is view layer agnostic.
Here we use the browser's built-in view to play the part.

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