Skip to content

Commit

Permalink
refactor: every over reduce
Browse files Browse the repository at this point in the history
  • Loading branch information
thejustinwalsh committed Sep 6, 2024
1 parent 59b4ed1 commit e651448
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hooks/useAssets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export function useAssets<T = any>(
options: UseAssetsOptions = {},
): UseAssetsResult<T>
{
const allAssetsAreLoaded = assets.reduce((acc, cur) => acc && assetsLoadedTest<T>(cur), true);
const allAssetsAreLoaded = assets.every((asset) => assetsLoadedTest<T>(asset));

const [state, setState] = useState<UseAssetsResult<T>>(
typeof window !== 'undefined' && allAssetsAreLoaded
Expand Down

0 comments on commit e651448

Please sign in to comment.