ts-elmish
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

ts-elmish

The Elm architecture for TypeScript.

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

yarn add ts-elmish

Example

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

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.

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.20latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.20
0.0.10
0.0.00

Package Sidebar

Install

npm i ts-elmish

Weekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

15.9 kB

Total Files

8

Last publish

Collaborators

  • ronalddijks