Skip to content

Commit

Permalink
remove devtools deprecated option
Browse files Browse the repository at this point in the history
  • Loading branch information
dai-shi committed Nov 13, 2023
1 parent 9a6bcad commit ec5f299
Showing 1 changed file with 2 additions and 21 deletions.
23 changes: 2 additions & 21 deletions src/vanilla/utils/devtools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,6 @@ type Options = {
name?: string
} & Config

export function devtools<T extends object>(
proxyObject: T,
options?: Options,
): (() => void) | undefined

/**
* @deprecated Please use { name } option
*/
export function devtools<T extends object>(
proxyObject: T,
name?: string,
): (() => void) | undefined

/**
* devtools
*
Expand All @@ -47,14 +34,8 @@ export function devtools<T extends object>(
*/
export function devtools<T extends object>(
proxyObject: T,
options?: Options | string,
) {
if (typeof options === 'string') {
console.warn(
'string name option is deprecated, use { name }. https://github.com/pmndrs/valtio/pull/400',
)
options = { name: options }
}
options?: Options,
): (() => void) | undefined {
const { enabled, name = '', ...rest } = options || {}

let extension: (typeof window)['__REDUX_DEVTOOLS_EXTENSION__'] | false
Expand Down

0 comments on commit ec5f299

Please sign in to comment.