Makes onCameraUpdate subscribe-able

This commit is contained in:
Benedicte Quimbert 2021-12-30 15:50:52 +01:00
parent d9482d484b
commit 85d45071fa

View File

@ -1,6 +1,6 @@
import { IframeApiContribution, sendToWorkadventure } from "./IframeApiContribution";
import { Subject } from "rxjs";
import type { WasCameraUpdatedEvent, WasCameraUpdatedEventCallback } from "../Events/WasCameraUpdatedEvent";
import type { WasCameraUpdatedEvent } from "../Events/WasCameraUpdatedEvent";
import { apiCallback } from "./registeredCallbacks";
import { isWasCameraUpdatedEvent } from "../Events/WasCameraUpdatedEvent";
@ -17,12 +17,12 @@ export class WorkAdventureCameraCommands extends IframeApiContribution<WorkAdven
}),
];
onCameraUpdate(callback: WasCameraUpdatedEventCallback): void {
moveStream.subscribe(callback);
onCameraUpdate(): Subject<WasCameraUpdatedEvent> {
sendToWorkadventure({
type: "onCameraUpdate",
data: null,
});
return moveStream;
}
}