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

Feeds #1

Closed
wants to merge 2 commits into from
Closed

Feeds #1

wants to merge 2 commits into from

Conversation

wittjosiah
Copy link
Owner

No description provided.

var sortedMsgIds = map(sortBy(entries(messages), ([msgId, timestamp]) => -timestamp), 0)
cb(null, sortedMsgIds)
})
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the case I wrote the example code for on scuttlebutt using ssb-query.
Note that my code did not handle the reducing down to check for things being untagged.

return map(sortBy(entries(messages), ([msgId, timestamp]) => -timestamp), 0)
})
)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a gotcha I don't like with flumeview-reduce - that view.stream is gonna blow up in your face !
Read the docs to understand why (I tried to leave a warning there), or just switch to use ssb-query with { live: true }!

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm going to try replacing this functionality with ssb-query. Not sure I understand what you're saying about this blowing up. I tried to handle both cases for when { live: true }, since tagKey will only exist on the root item if it is an incremental live update, is that the gotcha you're talking about?

@wittjosiah wittjosiah closed this Jun 5, 2020
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

Successfully merging this pull request may close these issues.

2 participants