All files / src fxs.js

100% Statements 9/9
83.33% Branches 5/6
100% Functions 6/6
100% Lines 9/9
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 231x     1x 1x         9x 9x       5x 5x 5x 5x          
import Rx from '@evo/rx';
 
export function rethrowFx(action, payload) {
  return function (stream) {
    stream.send(action, payload)
  }
}
 
export function subcomponentFx(subName, dispatchSub) {
  return function (stream) {
      stream.subStream(subName, dispatchSub);
  }
}
 
export function childFx(effect, streamName, metadata = null) {
  return (streamWrapper) => {
      const substream = streamWrapper.subWithMeta(streamName, metadata);
      return effect
          ? effect(substream)
          : Rx.helpers.noop;
  };
}