rename to tick, remove callback interface

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

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

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

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

Loading…
Cancel
Save