Einar Norðfjörð

Results 49 comments of Einar Norðfjörð

Imagine you've got a timer and want to cancel it when listeners stop: ```ts function interval(ms: number) { const s = stream() let i = 0; const interval = setInterval(()=>...

I think I understand what you want. You want the types to be something like: ```ts flyd.stream(v: T): WritableStream type Stream = WritableStream | ReadonlyStream map(fn: (v: T)=> V) =>...

Hey again! > Maybe I can rework the typings in such a way and contribute it back to the project? Absolutely! Feel free to submit a PR with reworked/better typings...

@StreetStrider I do believe the test framework and eslint settings are due for an overhaul. For instance the tests fail if I use arrow functions as that's not permissible by...

@StreetStrider I've updated the PR returning a Promise instead of using `done`

Both are fairly easily implemented. Feel free to take these and use them. ```js export const debounce = ms => s => { var timeout return flyd.combine((s,self)=> { clearTimeout(timeout) timeout...

You could use [ramda](https://ramdajs.com/docs/#sequence) to help you there Maybe something like this could do the trick for you? ```js const urlStream = flyd.stream() // Stream string const joinedUrlStream = urlStream...

I'm not quite sure what you're trying to achieve with the metadata thing, could you elaborate a bit on what it is you're actually trying to achieve?

Perhaps you could in your library do something like: ```js const stream = (...args)=> { const s = flyd.stream(...args); s.metadata = flyd.stream(); // pretend we received an update s.metadata.map(()=> s(s()));...

We could take a hint from mithril's stream implementation https://github.com/MithrilJS/mithril.js/blob/next/stream/stream.js#L24-L39 where they use `Object.defineProperty` to create a getter for an `end` stream. This means the end stream is not created...