Skip to content

Commit

Permalink
feature: make data in emitTo* methods be optional
Browse files Browse the repository at this point in the history
  • Loading branch information
franleplant committed Dec 23, 2020
1 parent f1be11d commit 4fa232f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Child.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export default class ChildAPI<TModel, TContext = any> extends Emittery {
}
}

emitToParent(eventName: string, data: unknown): void {
emitToParent(eventName: string, data?: unknown): void {
debug(`emitToParent "%s" with data %O`, eventName, data);

this.parent.postMessage(
Expand Down
2 changes: 1 addition & 1 deletion src/Parent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ export default class ParentAPI extends Emittery {
}
}

emitToChild(eventName: string, data: unknown): void {
emitToChild(eventName: string, data?: unknown): void {
debug(`emitToChild "%s" with data %O`, eventName, data);

this.child.postMessage(createParentEmit(eventName, data), this.childOrigin);
Expand Down

0 comments on commit 4fa232f

Please sign in to comment.