Change name of function
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user