--- layout: docs title: Task edit_url: "https://github.com/nylas/N1/blob/master/src/flux/tasks/task.coffee" ---

Summary

Tasks represent individual changes to the datastore that alter the local cache and need to be synced back to the server.

To create a new task, subclass Task and implement the following methods:

Tasks may also implement shouldDequeueOtherTask(other). Returning true will cause the other event to be removed from the queue. This is useful in offline mode especially, when the user might Save,Save,Save,Save,Send. Each newly queued Save can cancel the (unstarted) save task in the queue.

Tasks that need to support undo/redo should implement canBeUndone, isUndo, createUndoTask, and createIdenticalTask.