Change name of function

This commit is contained in:
2020-02-27 23:05:55 +01:00
parent e212829db5
commit 898b8bd830
2 changed files with 3 additions and 2 deletions

View File

@@ -21,7 +21,7 @@ export const debounce = (callback, wait, immediate = false) => {
** Throttle function with a delay
** (Throttling enforces a maximum number of times a function can be called over time, as in 'execute this function at most once every 100 milliseconds)
*/
export function throttled (fn, delay) {
export function throttle (fn, delay) {
let lastCall = 0
return function (...args) {
const now = (new Date).getTime()

View File

@@ -1,6 +1,7 @@
<script>
import { onMount } from 'svelte'
import { flip } from 'svelte/animate'
import { fly, fade } from 'svelte/transition'
import { locations, countries, continents } from '../store'
import { crossfadeReceive, crossfadeSend } from '../animations'
import * as fn from '../functions'
@@ -25,7 +26,7 @@
// Filter by continent
// Detects if click difference if too short with a throttled function
const toggleContinents = fn.throttled((event, continent) => {
const toggleContinents = fn.throttle((event, continent) => {
continentsFiltered = (!continent) ? [...continentsToDisplay] : [continent]
}, transitionDuration)