Skip to content

Commit

Permalink
Remove redundant static properties from BaseRealtime
Browse files Browse the repository at this point in the history
These already exist in its superclass BaseClient.
  • Loading branch information
lawrence-forooghian committed Nov 6, 2023
1 parent 89c0761 commit 96f4cf8
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 16 deletions.
5 changes: 0 additions & 5 deletions src/common/lib/client/baserealtime.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { ChannelOptions } from '../../types/channel';
import ClientOptions from '../../types/ClientOptions';
import * as API from '../../../../ably';
import ConnectionManager from '../transport/connectionmanager';
import Platform from 'common/platform';
import Message from '../types/message';
import { ModulesMap } from './modulesmap';

/**
Expand Down Expand Up @@ -45,10 +43,7 @@ class BaseRealtime extends BaseClient {

static Utils = Utils;
static ConnectionManager = ConnectionManager;
static Platform = Platform;
static ProtocolMessage = ProtocolMessage;
static Message = Message;
static Crypto?: typeof Platform.Crypto;
}

class Channels extends EventEmitter {
Expand Down
4 changes: 2 additions & 2 deletions src/platform/nativescript/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Common
import BaseClient from '../../common/lib/client/baseclient';
import { DefaultRest } from '../../common/lib/client/defaultrest';
import { DefaultRealtime } from '../../common/lib/client/defaultrealtime';
import Platform from '../../common/platform';
Expand Down Expand Up @@ -29,8 +30,7 @@ Platform.Config = Config;
Platform.Transports = Transports;
Platform.WebStorage = WebStorage;

DefaultRest.Crypto = Crypto;
DefaultRealtime.Crypto = Crypto;
BaseClient.Crypto = Crypto;

Logger.initLogHandlers();

Expand Down
4 changes: 2 additions & 2 deletions src/platform/nodejs/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Common
import BaseClient from '../../common/lib/client/baseclient';
import { DefaultRest } from '../../common/lib/client/defaultrest';
import { DefaultRealtime } from '../../common/lib/client/defaultrealtime';
import Platform from '../../common/platform';
Expand All @@ -25,8 +26,7 @@ Platform.Config = Config;
Platform.Transports = Transports;
Platform.WebStorage = null;

DefaultRest.Crypto = Crypto;
DefaultRealtime.Crypto = Crypto;
BaseClient.Crypto = Crypto;

Logger.initLogHandlers();

Expand Down
4 changes: 2 additions & 2 deletions src/platform/react-native/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Common
import BaseClient from '../../common/lib/client/baseclient';
import { DefaultRest } from '../../common/lib/client/defaultrest';
import { DefaultRealtime } from '../../common/lib/client/defaultrealtime';
import Platform from '../../common/platform';
Expand Down Expand Up @@ -29,8 +30,7 @@ Platform.Config = Config;
Platform.Transports = Transports;
Platform.WebStorage = WebStorage;

DefaultRest.Crypto = Crypto;
DefaultRealtime.Crypto = Crypto;
BaseClient.Crypto = Crypto;

Logger.initLogHandlers();

Expand Down
4 changes: 2 additions & 2 deletions src/platform/web-noencryption/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Common
import BaseClient from '../../common/lib/client/baseclient';
import { DefaultRest } from '../../common/lib/client/defaultrest';
import { DefaultRealtime } from '../../common/lib/client/defaultrealtime';
import Platform from '../../common/platform';
Expand All @@ -24,8 +25,7 @@ Platform.Config = Config;
Platform.Transports = Transports;
Platform.WebStorage = WebStorage;

DefaultRest.Crypto = null;
DefaultRealtime.Crypto = null;
BaseClient.Crypto = null;

Logger.initLogHandlers();

Expand Down
4 changes: 2 additions & 2 deletions src/platform/web/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
// Common
import BaseClient from '../../common/lib/client/baseclient';
import { DefaultRest } from '../../common/lib/client/defaultrest';
import { DefaultRealtime } from '../../common/lib/client/defaultrealtime';
import Platform from '../../common/platform';
Expand Down Expand Up @@ -27,8 +28,7 @@ Platform.Config = Config;
Platform.Transports = Transports;
Platform.WebStorage = WebStorage;

DefaultRest.Crypto = Crypto;
DefaultRealtime.Crypto = Crypto;
BaseClient.Crypto = Crypto;

Logger.initLogHandlers();

Expand Down
1 change: 0 additions & 1 deletion src/platform/web/modules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Platform.Transports = Transports;
Platform.WebStorage = WebStorage;

BaseClient.Crypto = Crypto;
BaseRealtime.Crypto = Crypto;

Logger.initLogHandlers();

Expand Down

0 comments on commit 96f4cf8

Please sign in to comment.