add Y.Array.from
This commit is contained in:
parent
39803c1d11
commit
4c46ebfb45
@ -53,6 +53,18 @@ export class YArray extends AbstractType {
|
|||||||
this._searchMarker = []
|
this._searchMarker = []
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construct a new YArray containing the specified items.
|
||||||
|
* @template T
|
||||||
|
* @param {Array<T>} items
|
||||||
|
* @return {YArray<T>}
|
||||||
|
*/
|
||||||
|
static from(items) {
|
||||||
|
const a = new YArray()
|
||||||
|
a.push(items)
|
||||||
|
return a
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Integrate this type into the Yjs instance.
|
* Integrate this type into the Yjs instance.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user