francauxach-forms

0.1.2 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i francauxach-forms

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • francauxach