Skip to content

Instantly share code, notes, and snippets.

@alexpersian
Last active July 3, 2016 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexpersian/88046fa6f370abb021bbe7165916c135 to your computer and use it in GitHub Desktop.
Save alexpersian/88046fa6f370abb021bbe7165916c135 to your computer and use it in GitHub Desktop.
struct Dispatch {
private func once(var predicate: Bool, block: () -> Void) {
if !predicate {
block()
predicate = true
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment