realm-js/lib/results.js
Scott Kyle 249bcd8f3f Change sortByProperty to return new Results
The method name changed to sortedBy to reflect that it returns a new Results object and to be more succinct. Also, the second optional argument instead reflects descending (or rather, reverse) since it's an anti-pattern to have an optional argument default to true in JS, and this also follows precedences set by other JS libraries and by Python's sorted function.
2016-02-18 11:58:39 -08:00

25 lines
451 B
JavaScript

/* Copyright 2015 Realm Inc - All Rights Reserved
* Proprietary and Confidential
*/
'use strict';
const constants = require('./constants');
const util = require('./util');
module.exports = {
create,
};
class Results {}
util.createMethods(Results.prototype, constants.objectTypes.RESULTS, [
'filtered',
'snapshot',
'sortedBy',
]);
function create(realmId, info) {
return util.createList(Results.prototype, realmId, info);
}