Skip to content

Commit

Permalink
B7161682765: Remove unused event.onceOn() method
Browse files Browse the repository at this point in the history
  • Loading branch information
josquindebaz committed Mar 15, 2024
1 parent 1983f31 commit a6de3c0
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 28 deletions.
16 changes: 0 additions & 16 deletions src/event.js
Expand Up @@ -97,22 +97,6 @@ export default function event(spec, my) {
return that;
}

/**
* Like on() except callback will only be fired once
*
* @deprecated use registerOnce() instead
* @param callback {function}
* @returns {eventBinding}
*/
that.onceOn = function (callback) {
// eslint-disable-next-line no-console
console.warn(
"Sending onceOn() to an event is deprecated. Send registerOnce() instead.",
);

return that.registerOnce(callback);
};

/**
* Like on() except callback will only be fired once
*
Expand Down
12 changes: 0 additions & 12 deletions test/events.test.js
Expand Up @@ -290,18 +290,6 @@ describe("deprecated", () => {
expect(console.warn).toHaveBeenCalled();
});

it("onceOn() method delegates to registerOnce", () => {
// Arrange: an event
let anEvent = event();
let spy = jasmine.createSpy("registerOnce");

anEvent.registerOnce = spy;
anEvent.onceOn(spy);

expect(spy).toHaveBeenCalled();
expect(console.warn).toHaveBeenCalled();
});

it("on() category method delegates to register", () => {
// Arrange: an event
let someEvents = eventCategory();
Expand Down

0 comments on commit a6de3c0

Please sign in to comment.