Git Product home page Git Product logo

rxsamples's Introduction

RxSamples

Here, we will talk about reactive programming in C# and .NET framework using the Rx.NET library. Reactive programming is widely in use in desktop and mobile applications nowadays.

ReactiveUI

For this sample, I used ReactiveUI to implement MVVM in the project. However, the ReactiveUI gives us a model-view-ViewModel framework for all .NET platforms. I chose a WPF application to implement the samples. For more information about the ReactiveUI and how to implement the MVVM, you can check the following links:

https://www.reactiveui.net/
https://github.com/reactiveui/reactiveui

Observables

In all the samples, we widely use Observables. If you are not familiar with the observer design pattern, visit the following links:

https://learn.microsoft.com/en-us/dotnet/standard/events/observer-design-pattern
https://learn.microsoft.com/en-us/dotnet/api/system.iobservable-1?view=net-7.0
https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.inotifypropertychanged?view=net-7.0

Marble Diagram

The best way to show the execution pipeline of the observables sequence is using marble diagrams. Hence, I use it in this repo and my blog as well. In the following figure, execution of the observables sequence is represented by a marble diagram.

Rx Operations

The following examples show some of the main Rx operations using a marble diagram.

Take

The Take(int count) operation is used to take a specific number of elements from an observable sequence.

Delay

The Delay(TimeSpan dueTime) operation is used to receive the values of an observable sequence by delay after the subscription.

Where

The Where(Func<TSource, bool> predicate) operation is used to filter out the values of an observable sequence.

Step Interval

https://parsakarami.com/Blog/Main/Post/Receiving_buffered_items_with_wait_time_intervals_in_RxNET

rxsamples's People

Contributors

parsakarami avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.