Skip to content

Commit

Permalink
fixup! Fix initial location being set too eagerly
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Piatek authored and dpiatek committed Jul 12, 2023
1 parent c0b78a5 commit f35c50b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/LocationTracker.mockClient.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand All @@ -13,7 +13,7 @@ interface LocationsTrackerTestContext {
locations: Locations;
spaceMember: SpaceMember;
locationTracker: LocationTracker<{ form: string }>;
validEvent: LocationChange;
validEvent: LocationChange<{ form: string }>;
space: Space;
spy: Mock;
}
Expand Down
2 changes: 1 addition & 1 deletion src/LocationTracker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SpaceMember } from './Space.js';
import { LOCATION_UPDATE } from './utilities/Constants.js';
import { EventListener } from './utilities/EventEmitter.js';

type LocationChange<T> = {
export type LocationChange<T> = {
member: SpaceMember;
previousLocation: unknown;
currentLocation: T;
Expand Down

0 comments on commit f35c50b

Please sign in to comment.