Skip to content

Instantly share code, notes, and snippets.

@Verdier
Verdier / ExempleReSwiftUI.swift
Last active March 27, 2024 02:26
Redux SwiftUI
struct MyView: View {
@StateObject var myValue = store.subscribe()
.map { state in state.myValue }
.toObservableObject(animation: .interactiveSpring()) // optional animation
@StateObject var myDerivedValue = store.subscribe()
.map { state in state.myValue }
.removeDuplicates()
.map { value in complexTransformation(value) } // triggered only on new value
.toObservableObject()
/sbin/iptables -F
/sbin/ip6tables -F
## Remove all current entries
/sbin/iptables -X
/sbin/ip6tables -X
## Drop inputs