4.1.2 • Published 8 years ago

tcomb-view v4.1.2

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

tcomb-view

render a view for tcomb types

inspired by tcomb-form

npm install --save tcomb-view

usage

view = require('tcomb-view')

element = view(h, props)

  • h: hyperx compatible module (e.g. virtual-dom/createElement, hyperscript, yo.createElement, react.createElement)
  • props.type: tcomb type to view
  • props.value: current value of tcomb type
  • props.onUpdate: optional function (value) {} to call when value is updated
  • props.layout: optional function (typeView, props) { return typeView } which will be called recursively to wrap each type's view function

TODO

support built-in tcomb types

  • t.String: strings
  • t.Number: numbers
  • t.Boolean: booleans
  • t.Array: arrays
  • t.Object: plain objects
  • t.Function: functions
  • t.Error: errors
  • t.RegExp: regular expressions
  • t.Date: dates
  • t.Nil: null or undefined
  • t.Any: any value

support built-in tcomb kinds

  • t.irreducible
  • t.refinement
  • t.enums
  • t.maybe
  • t.struct
  • t.tuple
  • t.list
  • t.dict
  • t.union
  • t.intersection
  • t.func
4.1.2

8 years ago

4.1.1

8 years ago

4.1.0

8 years ago

4.0.0

8 years ago

3.0.0

8 years ago

2.0.3

8 years ago

2.0.2

8 years ago

2.0.1

8 years ago

2.0.0

8 years ago

1.0.0

8 years ago