'use babel'
// @flow

import {selectCacheBlobsOfTask, selectCacheBlobsOfStep} from '../Selectors/CacheBlobs';
import {addCacheBlob} from '../Actions/AddCacheBlob';
import type {CacheBlob} from '../Types/types.js.flow';
import {selectTaskOfID} from '../../TaskExecutionFeature/Selectors/Tasks';
import {selectTasksReducer, selectCacheBlobsReducer} from '../../../GlobalSystem/Selectors';
import moment from 'moment';

export default function getCacheAPI(taskId: string, getState, dispatch) {
  return {
    get({step = null, excludeNullStep = true} = {}): Array<CacheBlob> {
      let blobs = selectCacheBlobsOfTask(selectCacheBlobsReducer(getState()), taskId);
      return step ? selectCacheBlobsOfStep(blobs, step, {excludeNull: excludeNullStep}) : blobs;
    },
    push(data: any, step = false: boolean): void {
      dispatch(addCacheBlob({
        data: data,
        step: step == true ? selectTaskOfID(selectTasksReducer(getState()), taskId).step : null,
        taskId: taskId,
        time: moment().unix(),
      }));
    },
  };
}

@@ -786,16 +786,8 @@
 step
- = false
 : bo
@@ -791,16 +791,24 @@
  boolean
+ = false
 ): void 

Correct flow type