Mailspring/packages/nylas-sync/syncback-task-factory.js

17 lines
448 B
JavaScript
Raw Normal View History

2016-06-24 06:46:52 +08:00
/**
* Given a `SyncbackRequestObject` it creates the appropriate syncback task.
*
*/
class SyncbackTaskFactory {
static create(account, syncbackRequest) {
2016-06-29 05:07:54 +08:00
if (syncbackRequest.type === "MoveToFolder") {
// TODO: Know it's IMAP from the account object.
const Task = require('./syncback_tasks/move-to-folder.imap');
return new Task(account, syncbackRequest)
2016-06-24 06:46:52 +08:00
}
2016-06-29 05:07:54 +08:00
return null
2016-06-24 06:46:52 +08:00
}
}
2016-06-29 05:07:54 +08:00
module.exports = SyncbackTaskFactory