Skip to content

Reactive extensions meant specifically for implementations of IObservable<bool>.

License

Notifications You must be signed in to change notification settings

DevJasperNL/Reactive.Boolean

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Reactive.Boolean

Reactive Extensions meant specifically for implementations of IObservable<bool>

This documentation uses marble diagrams to explain the transformations of IObservable<bool>. More on marble diagrams can be found in the documentation of ReactiveX.

Logical Operators

This library has extension methods for logical operators:

Not

Not

And

And

And (not distinct)

And (not distinct)

Or

Or

Or (not distinct)

Or (not distinct)

XOr

XOr

Scheduling

This library also has extension methods for scheduling:

PersistTrueFor

Returns an observable that stays true for a time span once the source observable turns back to false.

PersistTrueFor

WhenTrueFor

Returns an observable that emits true once the source observable emits true for a minimum time span.

WhenTrueFor

LimitTrueDuration

Returns an observable that stays true for a maximum of time span. If the source observable emits false before the time has passed, the resulting observable also emits false.

LimitTrueDuration

Subscribing

Besides transformations, this library has extension methods that help with common cases of subscribing to implementations of IObservable<bool>: SubscribeTrueFalse, SubscribeFalse and SubscribeTrue.

Example

boolObservable.SubscribeTrueFalse(
    () => {
        // Logic for when observable emits true.
    },
    () => {
        // Logic for when observable emits false.
    }
)

About

Reactive extensions meant specifically for implementations of IObservable<bool>.

Resources

License

Stars

Watchers

Forks

Languages