import { Effects , get } from '@typed/effects' ; import { Subscription } from '@typed/subscription' ; import { ConnectionEnv , Message , MessageDirection } from '../domain/model' ; export function * getSubscription ( direction ) { const { connection } = yield * get < ConnectionEnv > ( ) ; return connection [ direction ] ; }