Last active
August 26, 2017 11:03
-
-
Save frootloops/1f1895a666d96c1f1b1fa074ec9438fa 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
| class TrackingClient: TrackingClientType { | |
| var providers = [TrackingProviderType]() | |
| func add(provider: TrackingProviderType) { | |
| providers.append(provider) | |
| } | |
| func track(event: TrackingEventType) { | |
| for provider in providers { | |
| provider.track(event: event) | |
| } | |
| } | |
| func associate(with user: User) { | |
| for provider in providers { | |
| provider.associate(with: user) | |
| } | |
| } | |
| func disassociateUser() { | |
| for provider in providers { | |
| provider.disassociateUser() | |
| } | |
| } | |
| func setup() { | |
| for provider in providers { | |
| provider.setup() | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment