This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
import Mapbox | |
import GLKit | |
extension Double { | |
func clamp(min: Double, max: Double) -> Double { | |
return Double.minimum(Double.maximum(self, min), max) | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Promise like subscriber, works with Equatable types and Optionals of Equatable types | |
// ie: | |
// let observer = document.mainStore | |
// .select { (state) -> UIState in state.ui } | |
// .then { _ in called += 1 } | |
// or | |
// let observer = document.mainStore | |
// .select { (state) -> String? in state.ui.selection } | |
// .then { _ in called += 1 } | |
// |