Created
December 14, 2017 00:54
-
-
Save zbarbuto/a261ac409f2c5f9a485723f553b97ac0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { ReduxDevtoolsExtensionConnection } from '@ngrx/store-devtools/src/extension'; | |
export class RemoteDevToolsConnectionProxy | |
implements ReduxDevtoolsExtensionConnection { | |
constructor(public remotedev: any, public instanceId: string) {} | |
subscribe(listener: (change: any) => void): any { | |
const listenerWrapper = (change: any) => { | |
listener(change); | |
}; | |
this.remotedev.subscribe(listenerWrapper); | |
// Hack fix for commit/time-travelling etc. if the devtools are already open | |
setTimeout(() => listenerWrapper({ type: 'START' })); | |
} | |
unsubscribe(): any { | |
// HACK fix bug in @ngrx/store-devtools that calls this instead of returning | |
// a lambda that calls it when their Observable wrapper is unsubscribed. | |
return () => this.remotedev.unsubscribe(this.instanceId); | |
} | |
send(action: any, state: any): any { | |
// Never called | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment