Skip to content

Commit

Permalink
Remove deprecated method "wrap" (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
ItalyPaleAle authored Dec 9, 2023
1 parent c88aaf4 commit ea6480e
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 37 deletions.
16 changes: 0 additions & 16 deletions Router.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,6 @@ export interface WrappedComponent {
//_sveltesparouter?: boolean
}

/**
* Wraps a component to add route pre-conditions.
*
* @deprecated Use `wrap` from `svelte-spa-router/wrap` instead. This function will be removed in a later version.
*
* @param component Svelte component for the route
* @param userData Optional object that will be passed to each `conditionsFailed` event
* @param conditions Route pre-conditions to add, which will be executed in order
* @returns Wrapped component
*/
export function wrap(
component: typeof SvelteComponent,
userData?: object,
...conditions: RoutePrecondition[]
): WrappedComponent

/**
* Navigates to a new page programmatically.
*
Expand Down
21 changes: 0 additions & 21 deletions Router.svelte
Original file line number Diff line number Diff line change
@@ -1,27 +1,6 @@
<script context="module">
import {readable, writable, derived} from 'svelte/store'
import {tick} from 'svelte'
import {wrap as _wrap} from './wrap'
/**
* Wraps a component to add route pre-conditions.
* @deprecated Use `wrap` from `svelte-spa-router/wrap` instead. This function will be removed in a later version.
*
* @param {SvelteComponent} component - Svelte component for the route
* @param {object} [userData] - Optional object that will be passed to each `conditionsFailed` event
* @param {...function(RouteDetail): boolean} conditions - Route pre-conditions to add, which will be executed in order
* @returns {WrappedComponent} Wrapped component
*/
export function wrap(component, userData, ...conditions) {
// Use the new wrap method and show a deprecation warning
// eslint-disable-next-line no-console
console.warn('Method `wrap` from `svelte-spa-router` is deprecated and will be removed in a future version. Please use `svelte-spa-router/wrap` instead. See http://bit.ly/svelte-spa-router-upgrading')
return _wrap({
component,
userData,
conditions
})
}
/**
* @typedef {Object} Location
Expand Down

0 comments on commit ea6480e

Please sign in to comment.