Skip to content

Commit c7a2862

Browse files
committed
fix(demo): execute dock actions without accumulating listeners
Count each action invocation directly, preserving the per-activation action contract without retaining entry activation subscriptions.
1 parent 66210f6 commit c7a2862

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

examples/demo-dock-client/src/index.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,9 @@ function getStore(): DemoStore {
4040
*/
4141
export default function setup(ctx: DockClientScriptContext): void {
4242
const store = getStore()
43-
ctx.current.events.on('entry:activated', () => {
44-
store.activations += 1
45-
store.events.emit('activated', store.activations)
46-
void ctx.messages.info(`Demo client script activated (#${store.activations} this page)`, {
47-
description: `Loaded from ${new URL(import.meta.url).pathname}`,
48-
})
43+
store.activations += 1
44+
store.events.emit('activated', store.activations)
45+
void ctx.messages.info(`Demo client script activated (#${store.activations} this page)`, {
46+
description: `Loaded from ${new URL(import.meta.url).pathname}`,
4947
})
5048
}

0 commit comments

Comments
 (0)