File tree 1 file changed +12
-12
lines changed
packages/runtime-core/src
1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -28,7 +28,11 @@ interface DevtoolsHook {
28
28
once : ( event : string , handler : Function ) => void
29
29
off : ( event : string , handler : Function ) => void
30
30
appRecords : AppRecord [ ]
31
- _buffer : any [ ] [ ]
31
+ /**
32
+ * Added at https://github.com/vuejs/devtools/commit/f2ad51eea789006ab66942e5a27c0f0986a257f9
33
+ * Returns wether the arg was buffered or not
34
+ */
35
+ cleanupBuffer ?: ( matchArg : unknown ) => boolean
32
36
}
33
37
34
38
export let devtools : DevtoolsHook
@@ -109,18 +113,14 @@ const _devtoolsComponentRemoved = /*#__PURE__*/ createDevtoolsComponentHook(
109
113
export const devtoolsComponentRemoved = (
110
114
component : ComponentInternalInstance
111
115
) => {
112
- if ( devtools && devtools . _buffer . length ) {
113
- let wasBuffered = false
114
- devtools . _buffer = devtools . _buffer . filter ( item => {
115
- if ( item . some ( arg => arg === component ) ) {
116
- wasBuffered = true
117
- return false
118
- }
119
- return true
120
- } )
121
- if ( wasBuffered ) return
116
+ if (
117
+ devtools &&
118
+ typeof devtools . cleanupBuffer === 'function' &&
119
+ // remove the component if it wasn't buffered
120
+ ! devtools . cleanupBuffer ( component )
121
+ ) {
122
+ _devtoolsComponentRemoved ( component )
122
123
}
123
- _devtoolsComponentRemoved ( component )
124
124
}
125
125
126
126
function createDevtoolsComponentHook ( hook : DevtoolsHooks ) {
You can’t perform that action at this time.
0 commit comments