feroult / yawp

Kotlin/Java API framework for Google Appengine
http://yawp.io
MIT License
131 stars 19 forks source link

YAWP! JS Class/Extending (help needed) #95

Closed feroult closed 8 years ago

feroult commented 8 years ago

Support a new way to create endpoint classes by subclassing the default yawp function.

Think about how to deal with ES5 / ES6 support.

For example:

class Person extends yawp('/people') {
    static active() {
        return Person.where({}).list;
    }

    activate() {
        this.active = true;
        this.save();
    }
}

All the other yawp methods still apply:

new Person({}).save().destroy();
Person.create({});
Person.update({});

Many possibilities...

luanpotter commented 8 years ago

I believe one would just need to do something like this: http://stackoverflow.com/a/38016336/1217989

feroult commented 8 years ago

Yeah. I've started something like this, take a look in this file/branch

feroult commented 8 years ago

This is already integrated in master. We just need to put up some documentation for the new client.