diff --git a/baconjs/baconjs-tests.ts b/baconjs/baconjs-tests.ts index e542ef1c9..5d5998b70 100644 --- a/baconjs/baconjs-tests.ts +++ b/baconjs/baconjs-tests.ts @@ -28,6 +28,9 @@ function CreatingStreams() { Bacon.fromEvent(process.stdin, "readable", () => { alert("Bacon!"); }); + Bacon.fromEvent($("body"), "click").onValue(() => { + alert("Bacon!"); + }); // This would create a stream that outputs a single value "Bacon!" and ends after that. The use of setTimeout causes the value to be delayed by 1 second. Bacon.fromCallback(callback => { diff --git a/baconjs/baconjs.d.ts b/baconjs/baconjs.d.ts index 0e3f77c12..a831e74f6 100644 --- a/baconjs/baconjs.d.ts +++ b/baconjs/baconjs.d.ts @@ -117,7 +117,7 @@ declare module Bacon { * alert("Bacon!"); * }); */ - function fromEvent(target:EventTarget|NodeJS.EventEmitter, eventName:string):EventStream; + function fromEvent(target:EventTarget|NodeJS.EventEmitter|JQuery, eventName:string):EventStream; /** * @callback Bacon.fromEvent~eventTransformer @@ -136,7 +136,7 @@ declare module Bacon { * alert("Bacon!"); * }); */ - function fromEvent(target:EventTarget|NodeJS.EventEmitter, eventName:string, eventTransformer:(event:A) => B):EventStream; + function fromEvent(target:EventTarget|NodeJS.EventEmitter|JQuery, eventName:string, eventTransformer:(event:A) => B):EventStream; /** * @callback Bacon.fromCallback1~f