Skip to content

Instantly share code, notes, and snippets.

@AlexDaSoul
Last active July 3, 2018 10:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AlexDaSoul/e20bd29b8f060ad15322078e6fb5c60f to your computer and use it in GitHub Desktop.
Save AlexDaSoul/e20bd29b8f060ad15322078e6fb5c60f to your computer and use it in GitHub Desktop.
ws-6
export interface WebSocketConfig {
url: string;
reconnectInterval?: number;
reconnectAttempts?: number;
}
export class WebsocketModule {
public static config(wsConfig: WebSocketConfig): ModuleWithProviders {
return {
ngModule: WebsocketModule,
providers: [{ provide: config, useValue: wsConfig }]
};
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment