Created
June 26, 2019 10:00
-
-
Save daehn/ee39b6c487496bbc4e2f6a7322e4cf78 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
final class OnceToken { | |
private(set) lazy var perform: () -> Void = { | |
self.closure() | |
return {} | |
}() | |
private let closure: () -> Void | |
init(execute closure: @escaping () -> Void) { | |
self.closure = closure | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment