diff --git a/types/baconjs/baconjs-tests.ts b/types/baconjs/baconjs-tests.ts index b7d6db4c0f..4affe6805c 100644 --- a/types/baconjs/baconjs-tests.ts +++ b/types/baconjs/baconjs-tests.ts @@ -252,19 +252,20 @@ function CombiningMultipleStreamsAndProperties() { { // To calculate the current sum of three numeric Properties, you can do: - var property = Bacon.constant(1), - stream = Bacon.once(2), + // (NOTE: combineWith requires the first type argument to be ErrorEvent, but the constant + // and once methods default to unknown, so we're forced to manually specify it) + let property = Bacon.constant(1), + stream = Bacon.once(2), constant = 3; - // NOTE: had to explicitly specify the typing for `x:number, y:number, z:number` - Bacon.combineWith((x:number, y:number, z:number) => x + y + z, property, stream, constant); + Bacon.combineWith((x, y, z) => x + y + z, property, stream, constant); } { // Assuming you've got streams or properties named `password`, `username`, `firstname` and `lastname`, you can do: - var password = Bacon.constant("easy"), - username = Bacon.constant("juha"), - firstname = Bacon.constant("juha"), - lastname = Bacon.constant("paananen"), + let password = Bacon.constant("easy"), + username = Bacon.constant("juha"), + firstname = Bacon.constant("juha"), + lastname = Bacon.constant("paananen"), // NOTE: you should provide `combineTemplate` typing explicitly! loginInfo = Bacon.combineTemplate