Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

svelte on destroy

import { onDestroy } from 'svelte';

export function onInterval(callback, milliseconds) {
	const interval = setInterval(callback, milliseconds);

	onDestroy(() => {
		clearInterval(interval);
	});
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: react fetch request with content type x-www-form-urlencoded 
Javascript :: adding hbs partials in express.js 
Javascript :: appregistry react native 
Javascript :: javascript 
Javascript :: generator function 
Javascript :: javascript math 
Javascript :: array length 
Javascript :: sequelize exclude attributes 
Javascript :: moment get difference between business dates 
Javascript :: react native elements bottom sheet 
Javascript :: discord.js mobile status 
Javascript :: how to call api on load using hooks in react 
Javascript :: p5js no stroke 
Javascript :: react native camscanner application mobile code 
Javascript :: js addeventlistener keyup android 
Javascript :: how to disable input in javascript 
Javascript :: converting circular structure to json 
Javascript :: fs renameSync 
Javascript :: how to use crypto module in nodejs 
Javascript :: rating calculator formula javascript 
Javascript :: Nuxt Use Nginx as reverse Proxy 
Javascript :: how to push in object in javascript 
Javascript :: d3.js onclick event 
Javascript :: how to convert json to javascript object 
Javascript :: You are trying to create a styled element with an undefined component.You may have forgotten to import it. 
Javascript :: string to object js 
Javascript :: Device detector in react js 
Javascript :: useref react class component 
Javascript :: angularjs date 
Javascript :: js how to filter range imutable array 
ADD CONTENT
Topic
Content
Source link
Name
5+5 =