Comments (3)
This should have been captured in the effects and then mapped to an event. 🤦♂️
from rxfeedback.swift.
@kzaher I think it's a very valid question, there are events that are not coming from UI and not reactions to our state change (NotificationCenter, connectivity). How to incorporate them? So far I've come up with the following pattern:
let willEnterForeground: (Driver<State>) -> Signal<Event> = { _ in
return NotificationCenter.default.rx
.notification(UIApplication.willEnterForegroundNotification)
.map({ _ in Event.reload })
.asSignal(onErrorSignalWith: .empty())
}
return Driver.system(
initialState: initialState,
reduce: reduce,
feedback: bindings, willEnterForeground, requests
)
from rxfeedback.swift.
@vadimtrifonov as far as I can tell that is one and only way how to do it :)
You can make it less verbose:
let loads = NotificationCenter.default.rx
.notification(UIApplication.willEnterForegroundNotification)
.map({ _ in Event.reload })
.asSignal(onErrorSignalWith: .empty())
return Driver.system(
initialState: initialState,
reduce: reduce,
feedback: bindings, { _ in reloads }, requests
)
from rxfeedback.swift.
Related Issues (20)
- Can't build version 1.1.0 with Carthage HOT 1
- Please update the examples in the README HOT 2
- Problem building dependencies of the example app. HOT 6
- RxFeedback example PlayCatch not working HOT 1
- Add more example about the new react function
- GithubPaginatedSearch example bug
- RxFeedback functions autocomplete problem HOT 2
- Ambiguous reference to member 'system(initialState:reduce:scheduler:feedback:)'
- The printing is printed only after network request is done.
- How can I fix this warning HOT 1
- RequestLifetimeTracking forwardRequests: Duplicate keys were found in Dictionary HOT 6
- Non-equatable requests in 2.0 HOT 6
- [Proposal] Introduce ObservableSystem make system chainable. HOT 3
- How to test the Event creation?
- [Proposal] React for Void?
- bind(self) { ... } leaks HOT 4
- [Request] Could you port RxFeedback to Combine HOT 2
- Carthage for macOS HOT 1
- New Release Tag HOT 11
- [Xcode 15 RC1 Bag] Names conflict HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxfeedback.swift.