Skip to content

bus.end() doesn't work if bus has no subscribers #572

Closed
@Macil

Description

@Macil
$ node
> var Bacon = require('baconjs');
undefined
> var bus = new Bacon.Bus();
undefined
> bus.ended
false
> bus.end()
undefined
> bus.ended
true
> bus.log('b');
Bacon.Bus()
> bus.push(5);
b 5
[ '<more>' ]

I acknowledged this in #517 and wrote it off as a design quirk, but I feel differently now after noticing the misleading value of the ended property and having spent a day tracking down an issue that ultimately stemmed from this. (I've worked around it by adding bus.onValue(function(){}); right after creating the bus.)

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