src/index.js
function fillDefaultResult(query) {
  if (!query) return {};

  const graph = query.graph || query;

  if (!Array.isArray(graph)) { // invalid graph
    return;
  }

  var defaultResult = {};

  graph.map(([stream, opts]) => {
    if (opts.as) {
      defaultResult[opts.as] = null;
    } else {
      defaultResult[stream] = null;
    }
  });

  return defaultResult;
}
function fillDefaultResult(query) {
  if (!query) return {};

  const graph = query.graph || query;

  if (!Array.isArray(graph)) { // invalid graph
    return;
  }

  var defaultResult = {};

  graph.map(([stream, opts]) => {
    if (opts.as) {
      defaultResult[opts.as] = null;
    } else {
      defaultResult[stream] = null;
    }
  });

  return defaultResult;
}
function fillDefaultResult ( query ) { if ( ! query ) return { } ; const graph = query . graph || query ; if ( ! Array . isArray ( graph ) ) { // invalid graph return ; } var defaultResult = { } ; graph . map ( ( [ stream , opts ] ) => { if ( opts . as ) { defaultResult [ opts . as ] = null ; } else { defaultResult [ stream ] = null ; } } ) ; return defaultResult ; }
Create an empty map of the top level query nodes so less boilerplate is required to test if a property exists in the wrapped component
Create an empty map of the top level query nodes so less boilerplate is required to test if a property exists in the wrapped component