import { ConnectionEnv , SendMessage } from '../domain/model' ; import { getSubscription } from './getSubscription' ; export const sendMessage = function * ( message , direction ) { const { publish } = yield * getSubscription ( direction ) ; return publish ( message ) ; } ;