Skip to content

transducers.drop(n) not working as expected #58

Open
@threepointone

Description

@threepointone
import csp, {go, chan} from 'js-csp';
let {fromColl, into, pipeline} = csp.operations;
import xd from 'transducers.js';

// the regular transducer works fine
console.log(xd.seq([1, 2, 3, 4, 5], xd.drop(2)))
// outputs [3, 4, 5]

// but not when used with a channel
go(function*(){
  var c = chan();
  pipeline(c, xd.drop(2), fromColl([1, 2, 3, 4, 5]));
  var res = yield into([], c);  
  console.log(res);
  // expected - [3, 4, 5]
  // actual - []
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions