Skip to content

Commit

Permalink
dispatch set detail to empty object by default
Browse files Browse the repository at this point in the history
  • Loading branch information
demiazz committed May 18, 2017
1 parent 775dd0d commit 80c7817
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion spec/events/dispatch.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("dispatch", () => {
describe("event detail", () => {
it("triggers event with `detail` equals to `null` by default", () => {
listener.and.callFake(event => {
expect(event.detail).toBe(null);
expect(event.detail).toEqual({});
});

subject.addEventListener("click", listener);
Expand Down
2 changes: 1 addition & 1 deletion src/events/dispatch.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const create = typeof window.CustomEvent === "function"
function dispatch(
target: EventTarget,
eventType: EventType,
detail: any = null,
detail: any = {},
options?: EventOptions = { bubbles: true, cancelable: true }
): boolean {
const bubbles = getProperty(options, "bubbles", true);
Expand Down

0 comments on commit 80c7817

Please sign in to comment.