Skip to content

Commit

Permalink
Remove circular dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
Dominik Piatek committed Aug 9, 2023
1 parent e872b84 commit 3afcb3c
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/CursorBatching.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Types } from 'ably';

import { CURSOR_UPDATE } from './Cursors.js';
import { CURSOR_UPDATE } from './CursorConstants.js';
import type { CursorUpdate } from './types.js';
import type { CursorsOptions } from './types.js';

Expand Down
1 change: 1 addition & 0 deletions src/CursorConstants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const CURSOR_UPDATE = 'cursorUpdate';
3 changes: 2 additions & 1 deletion src/Cursors.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { it, describe, expect, vi, beforeEach, vitest, afterEach } from 'vitest'
import { Realtime, Types } from 'ably/promises';

import Space from './Space.js';
import Cursors, { CURSOR_UPDATE } from './Cursors.js';
import Cursors from './Cursors.js';
import { CURSOR_UPDATE } from './CursorConstants.js';
import { createPresenceMessage } from './utilities/test/fakes.js';
import CursorBatching from './CursorBatching.js';
import CursorDispensing from './CursorDispensing.js';
Expand Down
3 changes: 1 addition & 2 deletions src/Cursors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import EventEmitter, {
type EventListener,
} from './utilities/EventEmitter.js';
import CursorHistory from './CursorHistory.js';
import { CURSOR_UPDATE } from './CursorConstants.js';

import type { CursorsOptions, CursorUpdate } from './types.js';
import type { RealtimeMessage } from './utilities/types.js';
Expand All @@ -18,8 +19,6 @@ type CursorsEventMap = {
cursorsUpdate: CursorUpdate;
};

export const CURSOR_UPDATE = 'cursorUpdate';

export default class Cursors extends EventEmitter<CursorsEventMap> {
private readonly cursorBatching: CursorBatching;
private readonly cursorDispensing: CursorDispensing;
Expand Down

0 comments on commit 3afcb3c

Please sign in to comment.