Created
October 22, 2017 03:22
-
-
Save azamsharp/2232e81e064a67ac7070580db87ec6f1 to your computer and use it in GitHub Desktop.
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 | |
class Dynamic<T> { | |
var bind :(T) -> () = { _ in } | |
var value :T? { | |
didSet { | |
bind(value!) | |
} | |
} | |
init(_ v :T) { | |
value = v | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment