Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Subscribe overload with riseOnSubscription parameter #260

Closed
wants to merge 1 commit into from

Conversation

MarquisMc
Copy link

@MarquisMc MarquisMc commented Oct 22, 2024

Fixes #215

Add Subscribe(Observer<T> observer, bool riseOnSubscription = true) overload to ReactiveProperty<T> class.

  • Add a new Subscribe method overload with riseOnSubscription parameter to ReactiveProperty<T> class in src/R3/ReactiveProperty.cs.
  • Update SubscribeCore method in ReactiveProperty<T> class to conditionally call observer.OnNext(currentValue) based on riseOnSubscription parameter.
  • Add new Subscribe method overloads with riseOnSubscription parameter to ObservableSubscribeExtensions class in src/R3/ObservableSubscribeExtensions.cs.
  • Add unit tests for the new Subscribe method overload with riseOnSubscription parameter in ReactiveProperty<T> class in tests/R3.Tests/ReactivePropertyTest.cs.

For more details, open the Copilot Workspace session.

Fixes Cysharp#215

Add `Subscribe(Observer<T> observer, bool riseOnSubscription = true)` overload to `ReactiveProperty<T>` class.

* Add a new `Subscribe` method overload with `riseOnSubscription` parameter to `ReactiveProperty<T>` class in `src/R3/ReactiveProperty.cs`.
* Update `SubscribeCore` method in `ReactiveProperty<T>` class to conditionally call `observer.OnNext(currentValue)` based on `riseOnSubscription` parameter.
* Add new `Subscribe` method overloads with `riseOnSubscription` parameter to `ObservableSubscribeExtensions` class in `src/R3/ObservableSubscribeExtensions.cs`.
* Add unit tests for the new `Subscribe` method overload with `riseOnSubscription` parameter in `ReactiveProperty<T>` class in `tests/R3.Tests/ReactivePropertyTest.cs`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/Cysharp/R3/issues/215?shareId=XXXX-XXXX-XXXX-XXXX).
@neuecc
Copy link
Member

neuecc commented Oct 23, 2024

We cannot accept AI-generated code unless you can explain the code yourself.

@neuecc neuecc closed this Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Reactiveproperty<T>.Subscribe(Observer<T> observer, bool riseOnSubscription = true) overload
2 participants