Skip to content

Commit 75b777d

Browse files
FatmeDimitarTachev
authored andcommitted
refactor: move the private method after the public
1 parent 4f67566 commit 75b777d

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

lib/services/livesync/playground/preview-app-livesync-service.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,27 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
5252
});
5353
}
5454

55+
public async syncFiles(data: IPreviewAppLiveSyncData, filesToSync: string[], filesToRemove: string[]): Promise<void> {
56+
this.showWarningsForNativeFiles(filesToSync);
57+
58+
for (const device of this.$previewSdkService.connectedDevices) {
59+
await this.$previewAppPluginsService.comparePluginsOnDevice(data, device);
60+
}
61+
62+
const platforms = _(this.$previewSdkService.connectedDevices)
63+
.map(device => device.platform)
64+
.uniq()
65+
.value();
66+
67+
for (const platform of platforms) {
68+
await this.syncFilesForPlatformSafe(data, platform, { filesToSync, filesToRemove, useHotModuleReload: data.appFilesUpdaterOptions.useHotModuleReload });
69+
}
70+
}
71+
72+
public async stopLiveSync(): Promise<void> {
73+
this.$previewSdkService.stop();
74+
}
75+
5576
private async initializePreviewForDevice(data: IPreviewAppLiveSyncData, device: Device): Promise<FilesPayload> {
5677
const filesToSyncMap: IDictionary<string[]> = {};
5778
const hmrData: IDictionary<IPlatformHmrData> = {};
@@ -98,27 +119,6 @@ export class PreviewAppLiveSyncService implements IPreviewAppLiveSyncService {
98119
return payloads;
99120
}
100121

101-
public async syncFiles(data: IPreviewAppLiveSyncData, filesToSync: string[], filesToRemove: string[]): Promise<void> {
102-
this.showWarningsForNativeFiles(filesToSync);
103-
104-
for (const device of this.$previewSdkService.connectedDevices) {
105-
await this.$previewAppPluginsService.comparePluginsOnDevice(data, device);
106-
}
107-
108-
const platforms = _(this.$previewSdkService.connectedDevices)
109-
.map(device => device.platform)
110-
.uniq()
111-
.value();
112-
113-
for (const platform of platforms) {
114-
await this.syncFilesForPlatformSafe(data, platform, { filesToSync, filesToRemove, useHotModuleReload: data.appFilesUpdaterOptions.useHotModuleReload });
115-
}
116-
}
117-
118-
public async stopLiveSync(): Promise<void> {
119-
this.$previewSdkService.stop();
120-
}
121-
122122
private async syncFilesForPlatformSafe(data: IPreviewAppLiveSyncData, platform: string, opts?: ISyncFilesOptions): Promise<FilesPayload> {
123123
this.$logger.info(`Start syncing changes for platform ${platform}.`);
124124

0 commit comments

Comments
 (0)