constructor (schema, nodeFactory) {
    super()

    /* istanbul ignore start */
    if (!schema) {
      throw new Error('schema is mandatory')
    }
    if (!nodeFactory) {
      throw new Error('nodeFactory is mandatory')
    }
    /* istanbul ignore end */

    this.schema = schema
    this.nodeFactory = nodeFactory
    this.nodes = new Map()
    this.indexes = new Map()

    // Sometimes necessary to resolve issues with updating indexes in presence
    // of cyclic dependencies
    this.__QUEUE_INDEXING__ = false
    this.queue = []
  }
@param {Schema} schema
    @param {Object} [options]