From f35c50bf1e8cbc01020d6ede34b8a29634d66676 Mon Sep 17 00:00:00 2001 From: Dominik Piatek Date: Tue, 11 Jul 2023 17:08:59 +0100 Subject: [PATCH] fixup! Fix initial location being set too eagerly --- src/LocationTracker.mockClient.test.ts | 6 +++--- src/LocationTracker.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/LocationTracker.mockClient.test.ts b/src/LocationTracker.mockClient.test.ts index 82305883..a7099732 100644 --- a/src/LocationTracker.mockClient.test.ts +++ b/src/LocationTracker.mockClient.test.ts @@ -2,8 +2,8 @@ import { it, describe, expect, vi, beforeEach, Mock } from 'vitest'; import { Realtime } from 'ably/promises'; import Space, { SpaceMember } from './Space.js'; -import Locations, { LocationChange } from './Locations.js'; -import LocationTracker, { LocationTrackerPredicate } from './LocationTracker.js'; +import Locations from './Locations.js'; +import LocationTracker, { LocationTrackerPredicate, LocationChange } from './LocationTracker.js'; import { createPresenceMessage } from './utilities/test/fakes.js'; import { LOCATION_UPDATE } from './utilities/Constants.js'; @@ -13,7 +13,7 @@ interface LocationsTrackerTestContext { locations: Locations; spaceMember: SpaceMember; locationTracker: LocationTracker<{ form: string }>; - validEvent: LocationChange; + validEvent: LocationChange<{ form: string }>; space: Space; spy: Mock; } diff --git a/src/LocationTracker.ts b/src/LocationTracker.ts index 70817404..f4cf5828 100644 --- a/src/LocationTracker.ts +++ b/src/LocationTracker.ts @@ -3,7 +3,7 @@ import { SpaceMember } from './Space.js'; import { LOCATION_UPDATE } from './utilities/Constants.js'; import { EventListener } from './utilities/EventEmitter.js'; -type LocationChange = { +export type LocationChange = { member: SpaceMember; previousLocation: unknown; currentLocation: T;