mirror of
https://github.com/yjs/yjs.git
synced 2026-02-24 04:01:14 +01:00
Implement unshift to y-arrays
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user