From 933326c41014129d4507e5abf03e356a6280e993 Mon Sep 17 00:00:00 2001 From: Scott Kyle Date: Thu, 17 Mar 2016 14:49:12 -0700 Subject: [PATCH] Add List splice method to API docs It was mysteriously missing! --- docs/list.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/list.js b/docs/list.js index 79ee73cc..94d1fecb 100644 --- a/docs/list.js +++ b/docs/list.js @@ -16,7 +16,6 @@ // //////////////////////////////////////////////////////////////////////////// - /** * Instances of this class will be returned when accessing object properties whose type is `"list"` * (see {@linkplain Realm~ObjectSchemaProperty ObjectSchemaProperty}). @@ -89,6 +88,19 @@ class List { */ push(...object) {} + /** + * Changes the contents of the list by removing objects and/or inserting new objects. + * @see {@linkcode https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/splice Array.prototype.splice} + * @param {number} index - The start index. If greater than the length of the list, + * the start index will be set to the length instead. If negative, then the start index + * will be counted from the end of the list (e.g. `list.length - index`). + * @param {number} [count=length - start] - The number of objects to remove from the list. + * @param {...Realm.Object} [object] - Objects to insert into the list starting at `index`. + * @returns {Realm.Object[]} containing the objects that were removed from the list. The + * array is empty if no objects were removed. + */ + splice(index, count, ...object) {} + /** * Add one or more objects to the _beginning_ of the list. * @param {...Realm.Object} object - Each object’s type must match