packages/mangojuice-lazy/src/createLazyBlock.js
function createLazyBlock(
  { resolver, chunkName, initModel, loadingView, messages } = {}
) {
  const resolveState = { resolver: null, block: null, msgs: [], chunkName };
  resolveState.resolver = createBlockResolver(resolver, resolveState);
  const lazyLogic = createLazyLogic(resolveState, initModel);
  const lazyView = createLazyView(resolveState, loadingView);
  const lazyMessages = createLazyMessages(resolveState, messages);

  return {
    resolver: resolveState.resolver,
    Logic: lazyLogic,
    View: lazyView,
    Messages: lazyMessages
  };
}
function createLazyBlock(
  { resolver, chunkName, initModel, loadingView, messages } = {}
) {
  const resolveState = { resolver: null, block: null, msgs: [], chunkName };
  resolveState.resolver = createBlockResolver(resolver, resolveState);
  const lazyLogic = createLazyLogic(resolveState, initModel);
  const lazyView = createLazyView(resolveState, loadingView);
  const lazyMessages = createLazyMessages(resolveState, messages);

  return {
    resolver: resolveState.resolver,
    Logic: lazyLogic,
    View: lazyView,
    Messages: lazyMessages
  };
}
function createLazyBlock ( { resolver , chunkName , initModel , loadingView , messages } = { } ) { const resolveState = { resolver : null , block : null , msgs : [ ] , chunkName } ; resolveState . resolver = createBlockResolver ( resolver , resolveState ) ; const lazyLogic = createLazyLogic ( resolveState , initModel ) ; const lazyView = createLazyView ( resolveState , loadingView ) ; const lazyMessages = createLazyMessages ( resolveState , messages ) ; return { resolver : resolveState . resolver , Logic : lazyLogic , View : lazyView , Messages : lazyMessages } ; }
Creates a Block which works as a proxy for some other block,
which will be returned by `resolver` function provided in the
options object. `resolver` can also return a promise which should
resolve and actual block.

@param  {function} options.resolver
@param  {string} options.chunkName
@param  {string} options.initModel
@param  {function} options.loadingView
@param  {Object} options.lazyCommands
@return {Object}
Creates a Block which works as a proxy for some other block which will be returned by resolver function provided in the options object . resolver can also return a promise which should resolve and actual block .