Skip to content

Working with js-csp channels #33

@Chris-Andrews

Description

@Chris-Andrews

I'm enjoying checking out transducers.js, but am currently running into an issue:

I have a js-csp channel created, and I want to create a new channel that applies a transducer transformation to the original. For a channel "chan" and transducer "xform", What I thought was the right approach from the documentation was:

newChan = seq(chan, xform);

This gives me the error "don't know how to sequence collection."

I am able to achieve the desired result with the workaround:

newChan = chan(, xform);
operations.pipe(chan, newChan);

This is ok, but doesn't seem like the intended method. Is there a method that will work more in the style of my first attempt? Is this something that should work if I implemented the @@transducer/init, @@transducer/step, and @@transducer/result methods properly for csp.chan.prototype?

Thanks for any help!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions