diff --git a/types/mithril/stream/index.d.ts b/types/mithril/stream/index.d.ts index f299a3ea11..62684fe448 100644 --- a/types/mithril/stream/index.d.ts +++ b/types/mithril/stream/index.d.ts @@ -5,9 +5,7 @@ declare namespace Stream { /** Sets the value of the stream. */ (value: T): this; /** Creates a dependent stream whose value is set to the result of the callback function. */ - map(f: (current: T) => Stream | T | void): Stream; - /** Creates a dependent stream whose value is set to the result of the callback function. */ - map(f: (current: T) => Stream | U): Stream; + map(f: (current: T) => U): Stream; /** This method is functionally identical to stream. It exists to conform to Fantasy Land's Applicative specification. */ of(val?: T): Stream; /** Apply. */ diff --git a/types/mithril/test/test-stream.ts b/types/mithril/test/test-stream.ts index ff86d62211..85d76252bb 100644 --- a/types/mithril/test/test-stream.ts +++ b/types/mithril/test/test-stream.ts @@ -204,6 +204,13 @@ import { Stream } from 'mithril/stream'; console.assert(doubled() === 4); } +{ + const s = stream("a"); + const t = s.map(() => 1); + const n = t() + 1; + console.assert(n === 2); +} + // scan {