Search code examples
c#arraysreactive-programmingreactivex

Concept of array in Reactivex


Hi I'm starting to use ReactiveX c#, all sounds good, except for a concept.

I dunno how to make a reactive array ( or collection or list)

I'd like to have something like ObservableCollection, but with concept of reactive. I would mean that no one of members of array is reactive, but is the array itself that is reactive, just like Observable collection.

I don't understand how can make this possible if all in a reactive is just a stream...

So the question is what's interface or object I should use to get a reactive array?

Thanks


Solution

  • If you are searching for something like an ObservableCollection powered with ReactiveX take a look on http://www.reactiveui.net. It is a MVVM Framework on top of ReactiveX.

    There is a ReactiveList which provides you observables for ItemsAdded, ItemsRemoved, Count, Changed and some more. And implements INotifyCollectionChanged as well.

    Look at the doku: https://github.com/reactiveui/ReactiveUI/blob/275eca3dc2e5fc93bddb137e60be32885f788688/docs/basics/reactive-list.md

    Don't hesitate to ask me if you have further questions.