MCPcopy Create free account
hub / github.com/codecombat/codecombat / fetchRequiredInitialData

Function fetchRequiredInitialData

app/core/store/modules/clans.js:89–101  ·  view source on GitHub ↗
({ commit, dispatch }, { optionalIdOrSlug })

Source from the content-addressed store, hash-verified

87
88 actions: {
89 async fetchRequiredInitialData ({ commit, dispatch }, { optionalIdOrSlug }) {
90 commit('setLoading', true)
91 try {
92 const fetchPromises = [dispatch('fetchMyClans'), dispatch('fetchPublicClans')]
93 if (optionalIdOrSlug) {
94 fetchPromises.push(dispatch('fetchClan', { idOrSlug: optionalIdOrSlug }))
95 }
96 await Promise.all(fetchPromises)
97 } catch (e) {
98 console.error(e)
99 }
100 commit('setLoading', false)
101 },
102
103 async fetchMyClans ({ commit }) {
104 const clans = await getMyClans()

Callers

nothing calls this directly

Calls 2

dispatchFunction · 0.85
errorMethod · 0.45

Tested by

no test coverage detected