Skip to content

Commit

Permalink
Use toAsyncIterable instead of toIterable
Browse files Browse the repository at this point in the history
fixes #7
  • Loading branch information
make-github-pseudonymous-again committed Aug 6, 2018
1 parent 3dc04eb commit a741863
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions src/chain.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fromAsyncIterable from './fromAsyncIterable' ;
import toIterable from './toIterable' ;
import toAsyncIterable from './toAsyncIterable' ;
import asyncIterableChain from './asyncIterableChain' ;
import asyncIterableMap from './asyncIterableMap' ;

Expand All @@ -9,6 +9,6 @@ import asyncIterableMap from './asyncIterableMap' ;
*/
export default function chain ( stream ) {

return fromAsyncIterable( asyncIterableChain( asyncIterableMap( toIterable , toIterable( stream ) ) ) ) ;
return fromAsyncIterable( asyncIterableChain( asyncIterableMap( toAsyncIterable , toAsyncIterable( stream ) ) ) ) ;

}
6 changes: 3 additions & 3 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import skip from './skip' ;
import split from './split' ;
import toArray from './toArray' ;
import toCallable from './toCallable' ;
import toIterable from './toIterable' ;
import toAsyncIterable from './toAsyncIterable' ;
import toIterator from './toIterator' ;
import toString from './toString' ;

Expand All @@ -41,7 +41,7 @@ export default {
split ,
toArray ,
toCallable ,
toIterable ,
toAsyncIterable ,
toIterator ,
toString ,
} ;
Expand All @@ -66,7 +66,7 @@ export {
split ,
toArray ,
toCallable ,
toIterable ,
toAsyncIterable ,
toIterator ,
toString ,
} ;
4 changes: 2 additions & 2 deletions src/map.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import fromAsyncIterable from './fromAsyncIterable' ;
import toIterable from './toIterable' ;
import toAsyncIterable from './toAsyncIterable' ;
import asyncIterableMap from './asyncIterableMap' ;

/**
Expand All @@ -9,6 +9,6 @@ import asyncIterableMap from './asyncIterableMap' ;
*/
export default function map ( callable , stream ) {

return fromAsyncIterable( asyncIterableMap( callable , toIterable( stream ) ) ) ;
return fromAsyncIterable( asyncIterableMap( callable , toAsyncIterable( stream ) ) ) ;

}
4 changes: 2 additions & 2 deletions src/toArray.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import toIterable from './toIterable' ;
import toAsyncIterable from './toAsyncIterable' ;
import asyncIterableToArray from './asyncIterableToArray' ;

/**
* Converts a stream to an array.
* @kind function
* @param {Stream} stream the stream to read from
*/
export default async stream => asyncIterableToArray( toIterable( stream ) ) ;
export default async stream => asyncIterableToArray( toAsyncIterable( stream ) ) ;
2 changes: 1 addition & 1 deletion src/toIterable.js → src/toAsyncIterable.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Converts a stream to an iterable.
* @param {Stream} stream the stream to read from
*/
export default async function* toIterable ( stream ) {
export default async function* toAsyncIterable ( stream ) {

while ( true ) {

Expand Down
4 changes: 2 additions & 2 deletions src/toIterator.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import toIterable from './toIterable' ;
import toAsyncIterable from './toAsyncIterable' ;

/**
* Converts a stream to an iterator.
* @kind function
* @param {Stream} stream the stream to read from
*/
export default stream => toIterable( stream )[Symbol.asyncIterator]( ) ;
export default stream => toAsyncIterable( stream )[Symbol.asyncIterator]( ) ;

0 comments on commit a741863

Please sign in to comment.