DraftEditingSession
Summary
DraftEditingSession is a small class that makes it easy to implement components that display Draft objects or allow for interactive editing of Drafts.
- It synchronously provides an instance of a draft via
draft()
, and triggers whenever that draft instance has changed. - It provides an interface for modifying the draft that transparently
batches changes, and ensures that the draft provided via
draft()
always has pending changes applied.
Instance Methods
draft()
Returns
Return Values |
---|
Returns the draft object with the latest changes applied. |
draftPristineBody()
Return Values |
---|
Returns the initial body of the draft when it was pristine, or null if the draft was never pristine in this editing session. Useful for determining if the body is still in an unchanged / empty state. |