Build 574548stable
Module 569926
922 characters · in no known chunkDependencies
Source Raw
function(e,t,n){"use strict";n.d(t,{x:()=>p,I:()=>E});var i=n(64700),r=n(17928),s=n(735438),a=n.n(s),o=n(636537),l=n(451988),u=n(228366),c=n(311043),d=n(652215);async function _(e){try{let t=(await o.Bo.get({url:d.Rsh.GAMES,query:{game_ids:e},rejectWithError:!0})).body;u.h.dispatch({type:"GAME_FETCH_SUCCESS",gameIds:e,games:t})}catch{u.h.dispatch({type:"GAME_FETCH_FAILURE",gameIds:e})}}let h=new l.OC(async e=>{u.h.dispatch({type:"GAME_FETCH",gameIds:e}),await Promise.all(a().chunk(e,20).map(_))},e=>!c.A.hasNoData(e));async function f(e){0!==e.length&&await h.queue(e)}let E=(0,r.UT)(c.A,{getQueryId:d.fic.GAME,get:e=>null==e?null:c.A.hasNoData(e)?r.V5:c.A.getGame(e)??null,load:async e=>{null!=e&&await f([e])},getIsLoading:e=>null!=e&&c.A.isFetching(e),getError:e=>null!=e&&c.A.didFetchingFail(e)?Error("Failed to fetch game data"):null});function p(e){i.useEffect(()=>{let t=e.map(e=>[e]);E.fetchMany(...t)},[e])}}