You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
this.messages = this.updates
// watch the updates and accumulate operations on the messages
.scan((messages: Message[],
operation: IMessagesOperation) => {
return operation(messages);
},
In above code snippet, what operation exactly is ? - "return operation(messages);". I don't see "operation" defined anywhere except there is an interface. I am looking for concrete method.
Thanks!
The text was updated successfully, but these errors were encountered:
Operations is way to perform changes to all the messages in the stream , at the same time.
In the above snippet operation is an inner function used for concatenation.
Here the incoming message stream is being scanned and then an " operation " is applied to it to add the new messages to the list of existing messages. The "operation" here being a concat operation, as it is updating the message stream with all the new messages.
You can do this manually yourself, without using the operation function, by adding the concatenation procedure in a later function call ( such as the addMessage() ) to update the message stream directly. However, although this leads to more semantic code, the message stream is no longer composable after this.
In above code snippet, what operation exactly is ? - "return operation(messages);". I don't see "operation" defined anywhere except there is an interface. I am looking for concrete method.
Thanks!
The text was updated successfully, but these errors were encountered: