i tried to follow the example Delta Format - Yjs Docs
if i use getText from doc like the example, it is working well
const ytext = ydoc.getText()
ytext.toDelta() // => []
ytext.insert(0, 'World', { bold: true })
ytext.insert(0, 'Hello ')
ytext.toDelta() // => [{ insert: 'Hello ' }, { insert: 'World', attributes: { bold: true } }]
But if i create a new Y.Text() object, delta not working, when i call toDelta in second time, it is still empty array
const ytext = new Y.Text()
ytext.toDelta() // => []
ytext.insert(0, 'World', { bold: true })
ytext.insert(0, 'Hello ')
ytext.toDelta() // => []