const Danbooru = req('danbooru')

module.exports = {
  namespaced: true,
  state: () => ({
    auth: {},
    safebooru: true,
    searches: [
      {
        tags: 'score:5..',
        random: ''
      }
    ]
  }),

  getters: {
    ''(state) {
      if(state.safebooru)
        return new Danbooru.Safebooru(state.auth)
      else
        return new Danbooru(state.auth)
    }
  }
}

const Danbooru = req('danbooru')

module.exports = {
  namespaced: true,
  state: () => ({
    auth: {},
    server: 'safe-danbooru',
    searches: [
      {
        tags: 'score:5..',
        random: ''
      }
    ]
  }),

  getters: {
    ''(state) {
      switch(state.server) {
        case 'danbooru': return new Danbooru(state.auth)
        case 'safe-danbooru': return new Danbooru.Safebooru(state.auth)
      }
    }
  }
}

Make server selection more modular
Make server selection more modular
