code: function validateModel(m = {}) {
    const { name, reducers, effects } = m;
  
    if (!name || typeof name !== "string") {
      throw new Error(ERROR.MODEL_NAME_MUST_BE_STRING);
    }
  
    if (name === "routing") {
      throw new Error(ERROR.MODEL_CAN_NOT_BE_ROUTING);
    }
  
    if (models.find(item => item.name === name)) {
      throw new Error(
        `Model "${name}" has been created, please select another name!`
      );
    }
  
    if (reducers !== undefined && !isObject(reducers)) {
      throw new Error(ERROR.MODEL_REDUCER_MUST_BE_VALID_OBJECT);
    }
  
    if (effects !== undefined && !isObject(effects)) {
      throw new Error(ERROR.MODEL_EFFECTS_MUST_BE_VALID_OBJECT);
    }
  
    m.reducers = filterHandles(reducers);
    m.effects = filterHandles(effects);
    return m;
  }
docs: validate model