Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
There an easier way? RXJS subject to increment likes on an array object
// this really what it takes to increment a counter on an item in my observable
// likes is a subject, broadcasting the updated array eventually to the source observable being rendered
(message: Message): IMessagesOperation =>
(messages: Message[]) => {
return Message) => {
// todo: check if user has already liked
if ( ==
return m
// help me find a better way please =)

This comment has been minimized.

Copy link

@oliamb oliamb commented May 31, 2017

Did you think about using .reduce() operator?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.