Skip to content

Commit

Permalink
nextTickPromise was exported and so should not be removed
Browse files Browse the repository at this point in the history
Marked it as deprecated instead
  • Loading branch information
ItalyPaleAle committed May 30, 2020
1 parent a663a71 commit 82b5e73
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Router.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,19 @@ function updateLink(node, href) {
// Add # to the href attribute
node.setAttribute('href', '#' + href)
}
/**
* Performs a callback in the next tick and returns a Promise that resolves once that's done
*
* @param {Function} cb - Callback to invoke
* @returns {Promise} Promise that resolves after the callback has been invoked, with the return value of the callback (if any)
* @deprecated Deprecated since version 2.2 and will be removed in version 3. Use `tick` from the Svelte runtime instead (`import {tick} from 'svelte'`).
*/
export function nextTickPromise(cb) {
// eslint-disable-next-line no-console
console.warn('nextTickPromise from \'svelte-spa-router\' is deprecated and will be removed in version 3; use the \'tick\' method from the Svelte runtime instead')
return tick().then(cb)
}
</script>

{#if componentParams}
Expand Down

0 comments on commit 82b5e73

Please sign in to comment.