Giter Site home page Giter Site logo

flow-highland's People

Contributors

greenkeeper[bot] avatar jgrund avatar johnsonw avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flow-highland's Issues

Importing stream types still causing problems

Importing Readable, Writable, and Duplex stream types is still causing flow to not work correctly. Instead of importing these types, we should use the following internal types:
stream$Readable
stream$Writable
stream$Duplex

Add `concat` method

Can you add the concat method to HighlandStream<T> class?

    concat(ys: HighlandStream<T> | Array<T>): HighlandStream<T>,

.parallel should return T

.parallel is currently returning HighlandStream, but it should return T. For example:

var readFile = _.wrapCallback(fs.readFile);
var filenames = _(['foo.txt', 'bar.txt', 'baz.txt']);

// read from up to 10 files at once
filenames.map(readFile)
   .parallel(3)
   .map((x:HighlandStreamT<Buffer>) => x.toString('utf8'))

Should be:

var readFile = _.wrapCallback(fs.readFile);
var filenames = _(['foo.txt', 'bar.txt', 'baz.txt']);

// read from up to 10 files at once
filenames.map(readFile)
   .parallel(3)
   .map((x:Buffer) => x.toString('utf8'))

Stream imports are being lost

We are doing:

import type { Writable, Readable, Duplex } from 'stream';

outside of the module declaration. This causes these types to be lost. For example, say I add the following line in the .flowconfig file of a different repo:

[libs]
node_modules/@mfl/flow-highland/flow-typed

Now, I add the following line in a source file:

import { Readable, Writable } from 'stream';

I will now receive the following flow error:'

Named import from module `stream`. This module has no named export called `Readable`.

To avoid this problem we can instead import these types within the module declaration.

Update module function overload

Update the module function overloads to add a case for stream handling.

Also, add a type for the invoke method.

Finally, Update consume so that what is pushed becomes the new return type.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.