Implement unshift to y-arrays

This commit is contained in:
Mansehej 2020-05-16 02:36:43 +05:30 committed by Mansehej Singh
parent 9fc18d5ce0
commit 8bb52a485a

View File

@ -121,6 +121,15 @@ export class YArray extends AbstractType {
this.insert(this.length, content)
}
/**
* Preppends content to this YArray.
*
* @param {Array<T>} content Array of content to preppend.
*/
unshift (content) {
this.insert(0, content)
}
/**
* Deletes elements starting from an index.
*