LoginSignup
7
2

More than 3 years have passed since last update.

ReactiveProperty v7.2.0 をリリースしました

Posted at

ReactiveProperty v7.2.0 をリリースしました。

NuGet パッケージはこちら

ReactiveProperty v7.2.0 | NuGet Gallery

追加

DisposePreviousValue 拡張メソッドが追加されています。
IObservable の最新より前の値に対して Dispose の呼び出しを行います。
ReadOnlyReactiveProperty<T> に対して Dispose の呼び出しが必要な型などを Select で生成して使う場合に便利です。

var source = new Subject<string>();

var rp = source.Select(x => new SomeDisposableObject(x))
    .DisposePreviousValue()
    .ToReadOnlyReactivePropertySlim();

source.OnNext("aaa");
source.OnNext("bbb"); // aaa から作られたものは Dispose される
source.OnComplete(); // ソースが終了したタイミングで現在の値も Dispose される
7
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
2