Created
September 24, 2021 08:34
-
-
Save serhiybutz/ef9954be6571a9cdeec269a1004188a4 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
extension SharedManager { | |
public func borrow<A>(_ a: Property<A>, | |
accessBlock: (inout Accessor<A>) -> Void) | |
{ | |
var _a = Accessor(a) | |
internalBorrow([a]) { | |
accessBlock(&_a) | |
} | |
} | |
public func borrow<A, B>(_ a: Property<A>, | |
_ b: Property<B>, | |
accessBlock: (inout Accessor<A>, | |
inout Accessor<B>) -> Void) | |
{ | |
var _a = Accessor(a) | |
var _b = Accessor(b) | |
internalBorrow([a, b]) { | |
accessBlock(&_a, &_b) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment