1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-12 22:57:38 +02:00

All: Started moving sync target logic under SyncTarget classes

This commit is contained in:
Laurent Cozic
2017-11-24 18:37:40 +00:00
parent 946ad7c71a
commit cc7cbc2ecf
7 changed files with 117 additions and 63 deletions

View File

@ -0,0 +1,16 @@
const syncTargetClasses_ = {
1: require('lib/SyncTarget1.js'),
2: require('lib/SyncTarget2.js'),
3: require('lib/SyncTarget3.js'),
};
class SyncTargetRegistry {
static classById(syncTargetId) {
if (!syncTargetClasses_[syncTargetId]) throw new Error('Invalid id: ' + syncTargetId);
return syncTargetClasses_[syncTargetId];
}
}
module.exports = SyncTargetRegistry;