derbyjs / racer

Realtime model synchronization engine for Node.js
1.18k stars 117 forks source link

Added the ability to use scope and functions as the skip and limit option #220

Open aliksend opened 9 years ago

aliksend commented 9 years ago

Now you can use scopes and functions as limit and skip options in filter. You can do pagination like this:

{
  limit: model.root.at('_session.items_in_page'), 
  skip: function(){ 
    model.root.get('_page.page_index') * parseInt(model.root.get('_session.items_in_page'))
  }
}