Skip to content

Commit

Permalink
fix(extensions): added sender constant to lazy extension
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewcourtice committed Sep 6, 2021
1 parent 5930537 commit 7af6778
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions extensions/lazy/src/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const SENDER = 'extension:lazy';
6 changes: 5 additions & 1 deletion extensions/lazy/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
import {
SENDER,
} from './constants';

import {
EVENTS,
BaseState,
Expand Down Expand Up @@ -52,7 +56,7 @@ export default function lazyExtension<TState extends BaseState>() {
const output = store.track(() => computedAsync(async onInvalidate => {
const result = await body(store.state, onInvalidate);

nextTick(() => store.emit(EVENTS.devtools.update, 'lazy', result));
nextTick(() => store.emit(EVENTS.devtools.update, SENDER, result));

return result;
}, defaultValue));
Expand Down

0 comments on commit 7af6778

Please sign in to comment.