Skip to content

Commit

Permalink
make options arg optional
Browse files Browse the repository at this point in the history
  • Loading branch information
James Lees committed Feb 11, 2020
1 parent 86f40ac commit 308314e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/pusher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default class Pusher {
connection: ConnectionManager;
timelineSenderTimer: PeriodicTimer;

constructor(app_key: string, options: Options) {
constructor(app_key: string, options?: Options) {
checkAppKey(app_key);
options = options || {};
if (!options.cluster && !(options.wsHost || options.httpHost)) {
Expand Down
2 changes: 2 additions & 0 deletions types/src/core/options.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { AuthOptions, AuthorizerGenerator } from './auth/options';
export interface PusherOptions {
cluster: string;
disableStats: boolean;
enableStats: boolean;
statsHost: string;
activity_timeout: number;
pong_timeout: number;
Expand All @@ -17,6 +18,7 @@ declare type Transport = 'ws' | 'wss' | 'xhr_streaming' | 'xhr_polling' | 'sockj
declare type AuthTransport = 'ajax' | 'jsonp';
export interface Options {
activityTimeout?: number;
enableStats?: boolean;
disableStats?: boolean;
authEndpoint?: string;
auth?: AuthOptions;
Expand Down
2 changes: 1 addition & 1 deletion types/src/core/pusher.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export default class Pusher {
timelineSender: TimelineSender;
connection: ConnectionManager;
timelineSenderTimer: PeriodicTimer;
constructor(app_key: string, options: Options);
constructor(app_key: string, options?: Options);
channel(name: string): Channel;
allChannels(): Channel[];
connect(): void;
Expand Down

0 comments on commit 308314e

Please sign in to comment.