-
- Notifications
You must be signed in to change notification settings - Fork 27
Add Flow<Boolean> operators: not(), inverted(), and toggle() #369
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
base: master
Are you sure you want to change the base?
Conversation
Co-authored-by: hoc081098 <36917223+hoc081098@users.noreply.github.com>
Flow<Boolean>.inverted() or Flow<Boolean>.not() or Flow<Boolean>.toggle()| @copilot update api files. See .github/workflows folder for references |
Co-authored-by: hoc081098 <36917223+hoc081098@users.noreply.github.com>
I have successfully updated the API files using the The API file has been updated and committed (6ee7d55). Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
| @copilot it seems that you used wrong command. There is a command to update .api files for all targets, just not jvm |
You're correct that I used However, I was able to successfully update the JVM API file, but the multiplatform klib API file needs the native compilation to succeed. Is there an alternative approach or specific configuration to work around the network restrictions in this environment? Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
This PR adds three new extension operators for
Flow<Boolean>that provide boolean negation functionality, addressing the feature request in the issue.New Operators
Flow<Boolean>.not()- Returns a Flow that emits the boolean negation of each value emitted by the source FlowFlow<Boolean>.inverted()- Alias fornot()Flow<Boolean>.toggle()- Alias fornot()Usage Example
Implementation
The implementation follows the established patterns in FlowExt:
map { !it }transformation@Suppress("NOTHING_TO_INLINE")for performance optimizationTesting
Added comprehensive unit tests covering:
Documentation
API Compatibility
api/FlowExt.apifile usingjvmApiDumpto include the new Boolean operators in the binary compatibility validationcom/hoc081098/flowext/BooleanOperatorsKtclass with the three public functions to maintain API compatibility trackingThis addition provides a commonly requested feature that aligns with boolean operators available in other reactive programming libraries, making FlowExt more feature-complete for boolean flow transformations.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.