mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-01 01:29:31 +08:00
chore: fix eslint in blocksuite (#9232)
This commit is contained in:
@@ -11,7 +11,10 @@ import type { WebSocketMessage } from './types';
|
||||
type AwarenessChanges = Record<'added' | 'updated' | 'removed', number[]>;
|
||||
|
||||
export class WebSocketAwarenessSource implements AwarenessSource {
|
||||
private _onAwareness = (changes: AwarenessChanges, origin: unknown) => {
|
||||
private readonly _onAwareness = (
|
||||
changes: AwarenessChanges,
|
||||
origin: unknown
|
||||
) => {
|
||||
if (origin === 'remote') return;
|
||||
|
||||
const changedClients = Object.values(changes).reduce((res, cur) =>
|
||||
@@ -31,7 +34,7 @@ export class WebSocketAwarenessSource implements AwarenessSource {
|
||||
);
|
||||
};
|
||||
|
||||
private _onWebSocket = (event: MessageEvent<string>) => {
|
||||
private readonly _onWebSocket = (event: MessageEvent<string>) => {
|
||||
const data = JSON.parse(event.data) as WebSocketMessage;
|
||||
|
||||
if (data.channel !== 'awareness') return;
|
||||
|
||||
@@ -5,7 +5,7 @@ import { diffUpdate, encodeStateVectorFromUpdate, mergeUpdates } from 'yjs';
|
||||
import type { WebSocketMessage } from './types';
|
||||
|
||||
export class WebSocketDocSource implements DocSource {
|
||||
private _onMessage = (event: MessageEvent<string>) => {
|
||||
private readonly _onMessage = (event: MessageEvent<string>) => {
|
||||
const data = JSON.parse(event.data) as WebSocketMessage;
|
||||
|
||||
if (data.channel !== 'doc') return;
|
||||
|
||||
Reference in New Issue
Block a user