Clarification on insert(), delete(), retain()
Closed this issue · 2 comments
I don't understand this extract from the official Quilljs website:
use the chainable
insert()
,delete()
, andretain()
methods to create new Deltas.
source: quilljs.com/docs/delta
Returns
this
for chainability.
source: github.com/quilljs/delta#insert
If this
is returned, it's not a new instance. Hence, why the doc refers to new Deltas ?
The full text is
It is not recommended to construct Deltas by hand—rather use the chainable insert(), delete(), and retain() methods to create new Deltas.
The first part is important as it sets the context that the user is wanting to mold the Delta content to their desire, and to do that with these functions. It is not saying that the functions each individually literally return a new Delta instance.