Skip to content

Commit 5c5464c

Browse files
committed
close #18: add dispatchEvent to block props
1 parent 8435e36 commit 5c5464c

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

src/Halation.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ class Halation extends PureComponent<HalationProps, HalationState> {
8888
this.moduleMap.set(name, module);
8989
}
9090
});
91+
this.dispatchEvent = this.dispatchEvent.bind(this);
92+
this.addBlockLoadManager = this.addBlockLoadManager.bind(this);
9193
}
9294

9395
static getDerivedStateFromProps(props: HalationProps, state: HalationState) {
@@ -149,7 +151,8 @@ class Halation extends PureComponent<HalationProps, HalationState> {
149151
moduleMap: this.moduleMap,
150152
loadManagerMap: this.loadManagerMap,
151153
refs: this.getRefs(),
152-
addBlockLoadManager: this.addBlockLoadManager.bind(this),
154+
addBlockLoadManager: this.addBlockLoadManager,
155+
dispatchEvent: this.dispatchEvent,
153156
};
154157
}
155158

src/types/halation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ export interface PropsAPI {
4747
loadManagerMap: Map<string, LoadManager>;
4848
refs: Refs;
4949
addBlockLoadManager: AddBlockLoadManager;
50+
dispatchEvent: (event: string) => void;
5051
}
5152

5253
export type ModuleMap = Map<string, Module>;

0 commit comments

Comments
 (0)