Using classes
class LoginForm {
constructor() {
this.username = ''
this.password = ''
}
get isValid() {
return Boolean(this.username && this.password)
}
reset() {
this.username = ''
this.password = ''
}
}import { LoginForm } from './models'
export const state = {
loginForm: new LoginForm()
}Serializing class values
Rehydrating classes
Last updated