3.3.1 • Published 1 year ago

factorial-form v3.3.1

Weekly downloads
149
License
MIT
Repository
github
Last release
1 year ago

Factorial form

Minimal library for dealing with form state.

Build Status JavaScript Style Guide

Installation

npm install factorial-form --save
yarn add factorial-form

Example

import { Form } from 'factorial-form'

const attributes = {
  name: 'paco',
  salary: 18000,
  created_at: 1497521766937,
  metadata: {
    friends: 12
  }
}
const schema = {
  name: 'string',
  salary: 'cents',
  age: 'timestamp',
  metadata: {
    friends: 'number'
  }
}

const form = new Form(attributes, schema)
const field = form.get('name')

field.value // => 'paco'
form.isDirty // => false

field.set('pepe')
field.value // => 'pepe'
field.isDirty // => true
form.isDirty // => true

Where is it used?

Developed and battle tested in production in Factorial

3.3.1

1 year ago

3.3.0

1 year ago

3.2.1

1 year ago

3.2.0

2 years ago

3.1.0

2 years ago

3.0.0

2 years ago

2.1.2

2 years ago

2.1.1

2 years ago

2.1.0

3 years ago

1.0.2

3 years ago

2.0.0

3 years ago

1.0.1

5 years ago

1.0.0

5 years ago

0.2.0

5 years ago

0.1.5

6 years ago

0.1.3

6 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago