Rename getRandomElement function to getRandomItem

This commit is contained in:
2022-06-13 15:26:53 +02:00
parent 622e304efa
commit cfd6173baf
3 changed files with 5 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
<script lang="ts">
import { onMount, onDestroy, getContext } from 'svelte'
import { getPosition, getRandomElement } from '$utils/functions'
import { getPosition, getRandomItem } from '$utils/functions'
export let type: string = undefined
export let autoRotate: boolean = true
@@ -18,7 +18,7 @@
$: globeResolution = innerWidth > 1440 && window.devicePixelRatio > 1 ? '4k' : '2k'
const { continents, locations } = getContext('global')
const randomContinent = getRandomElement(continents.filter((cont: any) => cont.countries))
const randomContinent = getRandomItem(continents.filter((cont: any) => cont.countries))
const markers = locations.map(({ name, slug, country, globe_close: isClose, coordinates: { coordinates }}: any) => ({
name,
slug,