Skip to content

A simple observable that when it's value is updated observers are signaled.

License

Notifications You must be signed in to change notification settings

electricessence/ObservableValue

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ObservableValue

NuGet

A simple observable (IObservable<T>) that when its value is updated (value changes), its observers are notified.
Will post current value (if initialized) when subscribing. Synchronized to ensure ordering.

System.Reactive is included and can be used to extend its behavior.

Usage

Namespace

using Open.Observable;

Creating

var value = new ObservableValue<int>(1 /* optional initial value */);

or

var value = ObservableValue.Create(1); // type inferred

Subscribing

value.Subscribe(v => { /* do something with the value */ });

Updating

var changed = value.Post(2);

About

A simple observable that when it's value is updated observers are signaled.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages