Skip to content

Chain methods on models #3

@LancelotP

Description

@LancelotP

For example we can run :

var Model = new factory(fooModel);

Mode.isValidName().isValidAge().toJSON()
.then(function (json) {
    return json
}
.catch(function (err) {
    // any error throw by is methods or toJSON
    throw err
}

This allow to chain and execute several methods without having to implement multiple promises.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions