Skip to content

v0.2.0

Choose a tag to compare

@pelotom pelotom released this 27 Aug 23:48
· 104 commits to master since this release

Fixed #3 by changing the API to require a value of the record type to be passed in when unionizing. As an example, what was before

const Foo = unionize<{
  x: number
  y: boolean
}>()

becomes

const Foo = unionize({
  x: ofType<number>(),
  y: ofType<boolean>(),
})

Slightly more verbose, but it has the advantage of being faster, more universally supported, and because the tags are now enumerable you can do things like directly pass the result of a unionize call to Redux' bindActionCreators.