rename to tick, remove callback interface

pull/2030/head
Rich Harris 6 years ago
parent 3c1734c1fc
commit 3ea5f3b8f0

@ -5,6 +5,6 @@ export {
afterUpdate,
setContext,
getContext,
nextTick,
tick,
createEventDispatcher
} from './internal';

@ -18,8 +18,7 @@ export function add_render_callback(fn) {
render_callbacks.push(fn);
}
export function nextTick(fn) {
if (fn) add_render_callback(fn);
export function tick() {
schedule_update();
return update_promise;
}

@ -1,5 +1,5 @@
<script>
import { nextTick } from 'svelte';
import { tick } from 'svelte';
export let snapshots = [];
@ -14,7 +14,7 @@
function log() {
snapshots.push(`before ${buttons[0].textContent}`);
nextTick(() => {
tick().then(() => {
snapshots.push(`after ${buttons[0].textContent}`);
});
}

Loading…
Cancel
Save