File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
packages/pinia/src/devtools Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -276,6 +276,11 @@ function addStoreToDevtools(app: DevtoolsApp, store: StoreGeneric) {
276276 componentStateTypes,
277277 app,
278278 settings : {
279+ logStoreChanges : {
280+ label : 'Notify about new/deleted stores' ,
281+ type : 'boolean' ,
282+ defaultValue : true ,
283+ } ,
279284 // useEmojis: {
280285 // label: 'Use emojis in messages ⚡️',
281286 // type: 'boolean',
@@ -443,14 +448,16 @@ function addStoreToDevtools(app: DevtoolsApp, store: StoreGeneric) {
443448 api . notifyComponentUpdate ( )
444449 api . sendInspectorTree ( INSPECTOR_ID )
445450 api . sendInspectorState ( INSPECTOR_ID )
446- toastMessage ( `Disposed "${ store . $id } " store 🗑` )
451+ api . getSettings ( ) . logStoreChanges &&
452+ toastMessage ( `Disposed "${ store . $id } " store 🗑` )
447453 }
448454
449455 // trigger an update so it can display new registered stores
450456 api . notifyComponentUpdate ( )
451457 api . sendInspectorTree ( INSPECTOR_ID )
452458 api . sendInspectorState ( INSPECTOR_ID )
453- toastMessage ( `"${ store . $id } " store installed 🆕` )
459+ api . getSettings ( ) . logStoreChanges &&
460+ toastMessage ( `"${ store . $id } " store installed 🆕` )
454461 }
455462 )
456463}
You can’t perform that action at this time.
0 commit comments