Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
];
ModelCtor.sharedCtor.returns = {root: true};
var remotingOptions = {};
extend(remotingOptions, options.remoting || {});
// create a sharedClass
var sharedClass = ModelCtor.sharedClass = new SharedClass(
ModelCtor.modelName,
ModelCtor,
remotingOptions
);
// setup a remoting type converter for this model
RemoteObjects.convert(typeName, function(val) {
return val ? new ModelCtor(val) : val;
});
// before remote hook
ModelCtor.beforeRemote = function(name, fn) {
var className = this.modelName;
this._runWhenAttachedToApp(function(app) {
var remotes = app.remotes();
remotes.before(className + '.' + name, function(ctx, next) {
return fn(ctx, ctx.result, next);
});
});
};
// after remote hook
ModelCtor.afterRemote = function(name, fn) {