Skip to content

Instantly share code, notes, and snippets.

@vincent-pradeilles
Created December 18, 2019 14:08
Show Gist options
  • Save vincent-pradeilles/4cf38b51aaf07670565bd58a1761947f to your computer and use it in GitHub Desktop.
Save vincent-pradeilles/4cf38b51aaf07670565bd58a1761947f to your computer and use it in GitHub Desktop.
@propertyWrapper
struct Cached<Input: Hashable, Output> {
private var cachedFunction: (Input) -> Output
var wrappedValue: (Input) -> Output {
get { return self.cachedFunction }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment