0.1.2 • Published 7 years ago

francauxach-forms v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Francauxach forms

Form objects pattern implementation for Javascript.

IMPORTANT: See also acacha-forms.

Installation

npm install francauxach-forms --save

Usage

After package installation you could user this package using ES6 import:

import Form from 'francauxach-forms'

Then you can create any form object using constructor, for example a Register User form:

let form = new Form( { name: 'Franc Auxach', email: 'francauxach@gmail.com', password: '123456', password_confirmation: '123456', terms: 'true' } )

And the use form methods like post to submit form:

form.post('/register')
  .then( response => {
    console.log('Register done!')
    //do what you need to do if register is ok
  })
  .catch( error => {
    console.log('Register error!')
  })

Form objects pattern

More info about this pattern at:

Other similar packages or software

Laracasts

This video series:

Inspired the creation of this package. Also Laravel Spark .

Resources