Skip to content

Merging (or converting between) changesets from a SourceList and changesets from a SourceCache #1020

Closed Answered by JakenVeina
ds090525 asked this question in Q&A
Discussion options

You must be logged in to vote

Seems like you're looking to collect ALL of your view models, of all different types, into one central collection? Perhaps to dispose them all?

Since you're using GUIDs, you're correctly interpreting that you can just merge all the streams together with native RX, as there's no real risk of key overlap. (At least, I THINK that's what the .Or() operator does, right? It's equivalent to a .Merge()?) Anyway, there's an operator you can use to just convert a list stream into a keyed stream, .AddKey(), since you HAVE a usable key.

var mergedChangeSets =_firstCache.Connect()
        .Transform(x => x as IViewModel)
    .Or(_secondCache.Connect()
        .Transform(x => x as IViewModel))
    .Or(_…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@ds090525
Comment options

Answer selected by ds090525
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants