--- layout: docs title: DraftStore edit_url: "https://github.com/nylas/N1/blob/master/src/flux/stores/draft-store.coffee" ---
DraftStore responds to Actions that interact with Drafts and exposes public getter methods to return Draft objects and sessions.
It also creates and queues Task objects to persist changes to the Nylas API.
Remember that a "Draft" is actually just a "Message" with draft: true
.
Fetch a DraftStoreProxy for displaying and/or editing the
draft with clientId
.
Example:
session = DraftStore.sessionForClientId(clientId)
session.prepare().then ->
# session.draft() is now ready
Argument | Description |
---|---|
clientId |
The String clientId of the draft. |
Return Values |
---|
Returns a Promise that resolves to an DraftStoreProxy for the draft once it has been prepared: |
Look up the sending state of the given draftClientId. In popout windows the existance of the window is the sending state.
Return Values |
---|
Returns the extensions registered with the DraftStore. |
Registers a new extension with the DraftStore. DraftStore extensions make it possible to extend the editor experience, modify draft contents, display warnings before draft are sent, and more.
Argument | Description |
---|---|
ext |
A DraftStoreExtension instance. |
Unregisters the extension provided from the DraftStore.
Argument | Description |
---|---|
ext |
A DraftStoreExtension instance. |