Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue flattening streams of Time.diagram()-generated streams? #229

Open
mathieueveillard opened this issue Nov 4, 2017 · 0 comments
Open

Comments

@mathieueveillard
Copy link

mathieueveillard commented Nov 4, 2017

Please consider the two unit tests below, run with Mocha, where Time = mockTimeSource() (@cycle/time):

    it("Test of flatten (1)", function (done) {
        Time.assertEqual(
            Time.diagram("0----1----").map(i => xs.of(i)).flatten(),
            Time.diagram("0----1----")
        )
        Time.run(done)
    })

    it("Test of flatten (2)", function (done) {
        Time.assertEqual(
            Time.diagram("0----1----").map(i => Time.diagram("i---------", {i: i})).flatten(),
            Time.diagram("0----1----")
        )
        Time.run(done)
    })

The former passes, the latter fails:
Expected 0----1 Got (01)

This sounds in contradiction with the definition of flatten. Is this a bug?

Thanks

Mat (new user of xstream and cycle.js)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant