@dotto.x/validator
v0.4.1
Published
Validate plugin for dotto.x
Downloads
24
Readme
dotto.x/validator
Validate all write operation with minimalistic interface
import { createStore } from 'dotto.x'
import { validator } from '@dotto.x/validator'
let testingStore = createStore({ test: 1 })
let { errors, destroy, valid } = validator(testingStore, [
{
path: 'test',
validators: [value => (value > 1 ? 'too much' : false)]
}
])
valid.subscribe(isValid => {})
errors.subscribe({test} => {})