Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ra1028/SwiftUI-Flux
:rocket: This is a tiny experimental application using SwiftUI with Flux architecture.
https://github.com/ra1028/SwiftUI-Flux
architecture bidirectional flux swiftui wwdc
Last synced: 3 months ago
JSON representation
:rocket: This is a tiny experimental application using SwiftUI with Flux architecture.
- Host: GitHub
- URL: https://github.com/ra1028/SwiftUI-Flux
- Owner: ra1028
- License: mit
- Created: 2019-06-06T11:24:25.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-06-06T11:27:07.000Z (over 5 years ago)
- Last Synced: 2024-10-27T15:49:45.697Z (3 months ago)
- Topics: architecture, bidirectional, flux, swiftui, wwdc
- Language: Swift
- Homepage:
- Size: 584 KB
- Stars: 54
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swiftui - ra1028/SwiftUI-Flux - This is a tiny experimental application using SwiftUI with Flux architecture. (Samples)
- fucking-about-SwiftUI - SwiftUI-Flux
README
# :rocket: SwiftUI-Flux
This is a tiny experimental application using `SwiftUI` with `Flux architecture`.```swift
struct CounterView : View {
enum Action {
case increment
case decrement
}@State var store = Store(initial: 0) { count, action in
switch action {
case .increment:
return count + 1case .decrement:
return max(0, count - 1)
}
}var body: some View {
VStack {
Text("\(store.state)")HStack {
Button(action: { self.store.dispatch(action: .decrement) }) {
Text("Decrement")
}Button(action: { self.store.dispatch(action: .increment) }) {
Text("Increment")
}
}
}
}
}
```## :clipboard: Requirements
- Swift5.1 Beta
- Xcode11.0 Beta
- iOS 13.0 Beta## :memo: License
SwiftUI-Flux is released under the [MIT License](./LICENSE).