mirror of
https://github.com/status-im/realm-js.git
synced 2025-01-21 03:50:28 +00:00
249bcd8f3f
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.
25 lines
451 B
JavaScript
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);
|
|
}
|