.is() doesn't work correctly when using the .from() helper to create tagged values
esrch opened this issue · 1 comments
esrch commented
let User = daggy.taggedSum('User', {
Nothing: [],
Person: ['name']
})
let user = User.Person('Ted')
console.log('Without from: ', User.is(user)) // => true
console.log('Without from: ', User.Person.is(user)) // => true
user = User.Person.from({ name: 'Tom' })
console.log('With from: ', User.is(user)) // => true
console.log('With from: ', User.Person.is(user)) // => false (should be true)
Here's a working example on CodeSandbox: https://codesandbox.io/s/j4z050m5mw
davidchambers commented