Skip to content

Commit

Permalink
Remove deprecated method "wrap"
Browse files Browse the repository at this point in the history
  • Loading branch information
ItalyPaleAle committed Dec 9, 2023
1 parent c88aaf4 commit c8a159d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 36 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
20 changes: 0 additions & 20 deletions Router.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,6 @@ import {readable, writable, derived} from 'svelte/store'
import {tick} from 'svelte'
import {wrap as _wrap} from './wrap'

Check failure on line 4 in Router.svelte

View workflow job for this annotation

GitHub Actions / test

'_wrap' is defined but never used
/**
* 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
* @property {string} location - Location (page/view), for example `/book`
Expand Down

0 comments on commit c8a159d

Please sign in to comment.