alanjames1987 / marilyn

Marilyn is a client side, Socket.IO driven, Pub/Sub, model layer with a query system similar to Mongoose.
MIT License
114 stars 3 forks source link

Feature: Configure Default Event Names #1

Open alanjames1987 opened 10 years ago

alanjames1987 commented 10 years ago

An option should exist when creating a model to add default CRUD event names, similar to how CanJS can configure default CRUD urls.

Marilyn.model('someModel', function(){

    this.crud({
        'create' : 'somModel_create',
        'read' : 'somModel_read',
        'readOne' : 'somModel_read_by',
        'update' : 'somModel_update',
        'delete' : 'somModel_delete',
    });

});

These events can then be used by Marilyn to automatically sync data back and forth to the server.

alanjames1987 commented 9 years ago

The backend Socket.IO would have to be configured correctly to use these types of events.

alanjames1987 commented 9 years ago

Backbone, Ember, and Angular models use a REST/ActiveResource type interface to perform these actions. There should be an REST/ActiveResource type interface for Socket.IO that this would follow.