ssbc / ssb-meta-feeds

10 stars 0 forks source link

fix branchStream "loadState" logic #111

Closed staltz closed 1 year ago

staltz commented 1 year ago

Context

https://github.com/ssbc/ssb-meta-feeds/pull/110#discussion_r1023762878

Problem

If you call branchStream with live first, and then immediately call branchStream with old second, then the second one will just assume that the state has loaded, without actually waiting for it.

Solution

Just a bit of booleans and some ifs.

1st :x: 2nd :heavy_check_mark: