Skip to content

Commit

Permalink
Allow attaching completion handler for updating context. (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
DenTelezhkin authored Feb 1, 2024
1 parent f1ae08f commit ebf32e6
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions Sources/UnleashProxyClientSwift/UnleashProxyClientSwift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ public class UnleashClientBase {
SwiftEventBus.unregister(self, name: name)
}

public func updateContext(context: [String: String], properties: [String:String]? = nil) -> Void {
public func updateContext(context: [String: String], properties: [String:String]? = nil, completionHandler: ((PollerError?) -> Void)? = nil) {
self.context = self.calculateContext(context: context, properties: properties)
self.stop()
self.start()
self.start(completionHandler: completionHandler)
}

func calculateContext(context: [String: String], properties: [String:String]? = nil) -> Context {
Expand Down

0 comments on commit ebf32e6

Please sign in to comment.