如何在 GetEventStore 中获取所有类别的列表?

How can I get a list of all categories in GetEventStore?

来自这样的信息流:

得到这样的东西:

[ "sales", "users"]

感谢nissbran from GitHub

fromStream('$streams')
.when({
$init: function () {
    return []
},
$any: function (s, e) {
    var category = e.streamId.split("-")[0];

    if (s.includes(category))
        return;

    s.push(category);
}
})