From 3ea5f3b8f0e93180acca730316e3c2b1c9469375 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Wed, 30 Jan 2019 15:06:06 -0500 Subject: [PATCH] rename to tick, remove callback interface --- index.mjs | 2 +- src/internal/scheduler.js | 3 +-- test/runtime/samples/lifecycle-next-tick/main.html | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/index.mjs b/index.mjs index 768b53f626..ee5b575171 100644 --- a/index.mjs +++ b/index.mjs @@ -5,6 +5,6 @@ export { afterUpdate, setContext, getContext, - nextTick, + tick, createEventDispatcher } from './internal'; diff --git a/src/internal/scheduler.js b/src/internal/scheduler.js index 7292c85f07..717a5c7ff4 100644 --- a/src/internal/scheduler.js +++ b/src/internal/scheduler.js @@ -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; } diff --git a/test/runtime/samples/lifecycle-next-tick/main.html b/test/runtime/samples/lifecycle-next-tick/main.html index f7a889d433..0c577c20e8 100644 --- a/test/runtime/samples/lifecycle-next-tick/main.html +++ b/test/runtime/samples/lifecycle-next-tick/main.html @@ -1,5 +1,5 @@