Last active
July 3, 2018 10:01
-
-
Save AlexDaSoul/e20bd29b8f060ad15322078e6fb5c60f to your computer and use it in GitHub Desktop.
ws-6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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