spawn = (type, task, ...[init]) => async (context) => {
  const ipfs = context.getIpfs()
  if (ipfs == null) {
    throw Error('IPFS node was not found')
  } else {
    const spawn = Task.spawn(
      type,
      /**
       * @param {Context} context
       * @returns {AsyncGenerator<Message, Success, void>}}
       */
      async function * (context) {
        const process = task(ipfs, context)
        while (true) {
          const next = await process.next()
          if (next.done) {
            return await next.value
          } else {
            yield next.value
          }
        }
      },
      init
    )

    return await spawn(context)
  }
}
Specialized version of `Task.spawn` which will only spawn a task if
`context.getIpfs()` returns an `IPFSService` passing it into the task as a
first argument. Otherwise it fails without dispatching any actions.

@template {string} Type - Corresponds to `action.type` for all the actions
that this task will dispatch.
@template Message - Type of messages that task will produce (by yielding).
Which correspond to `action.task.message` when `action.status`
is `Send`.
@template Success - Type of the `action.task.result.vaule` when task is
complete successfully. It is also a value of the promise returned by
running `store.doX` created by this decorator.
@template Init - Type of the initialization paramater.
@template State - Type of the `context.getState()` for this task.
@template {BundlerContext<State, Spawn<Type, Message, Error, Success, Init>, Ext, Extra>} Context

@param {Type} type - Type of the actions this will dispatch.
@param {(service:IPFSService, context:Context) => AsyncGenerator<Message, Success, void>} task - Task
@param {Init[]} rest - Optinal initialization parameter.
@returns {(context:Context) => Promise<Success>}