You've already forked joplin
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:
16
ReactNativeClient/lib/SyncTargetRegistry.js
Normal file
16
ReactNativeClient/lib/SyncTargetRegistry.js
Normal 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;
|
Reference in New Issue
Block a user