Skip to content

Commit

Permalink
refactor: remove NTD tasks from entry point
Browse files Browse the repository at this point in the history
  • Loading branch information
matey97 committed Jun 23, 2022
1 parent d8e88c5 commit a1d3b52
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
9 changes: 2 additions & 7 deletions src/wearos-sensors.android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { getHeartRateRecordService } from "./internal/sensors/heart-rate/android
import { getCommandService } from "./internal/communication/command/command-service.android";
import { SensorType } from "./internal/sensors/sensor-type";

import { Task } from "nativescript-task-dispatcher/tasks";
import { TaskGraph } from "nativescript-task-dispatcher/internal/tasks/graph";
import WearableListenerServiceDelegate = es.uji.geotec.wearos_sensors.messaging.WearableListenerServiceDelegate;
import WearosSensorsCapabilityAdvertiserService = es.uji.geotec.wearos_sensors.messaging.WearosSensorsCapabilityAdvertiserService;
import WearosSensorsResultsMessagingService = es.uji.geotec.wearos_sensors.messaging.WearosSensorsResultsMessagingService;
Expand All @@ -20,11 +18,8 @@ import WearosSensorsCommandService = es.uji.geotec.wearos_sensors.command.Wearos
import WearSensor = es.uji.geotec.wearos_sensors.WearSensor;

export class WearosSensors extends Common {
async init(
appTasks: Array<Task>,
taskGraph: TaskGraph
): Promise<void> {
await super.init(appTasks, taskGraph);
init(): void {
super.init();

this.wireUpCapabilityAdvertiser();
this.wireUpCommandService();
Expand Down
9 changes: 1 addition & 8 deletions src/wearos-sensors.common.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
import { Observable } from "@nativescript/core";
import { Task } from "nativescript-task-dispatcher/tasks";
import { TaskGraph } from "nativescript-task-dispatcher/internal/tasks/graph";
import { taskDispatcher } from "nativescript-task-dispatcher";
import { internalTasks } from "./internal/tasks";
import { EventData } from "nativescript-task-dispatcher/events";


export class Common extends Observable {
async init(
appTasks: Array<Task>,
taskGraph: TaskGraph
): Promise<void> {
await taskDispatcher.init([...internalTasks, ...appTasks], taskGraph);
init(): void {
}

public emitEvent(eventName: string, eventData?: EventData) {
Expand Down

0 comments on commit a1d3b52

Please sign in to comment.