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
| public class Channel<Value> { | |
| private class Subscription { | |
| weak var object: AnyObject? | |
| private let notifyBlock: (Value) -> Void | |
| private let queue: DispatchQueue | |
| var isValid: Bool { | |
| return object != nil |
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
| // | |
| // debounce-throttle.swift | |
| // | |
| // Created by Simon Ljungberg on 19/12/16. | |
| // License: MIT | |
| // | |
| import Foundation | |
| extension TimeInterval { |
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
| private class HttpInterceptor implements Interceptor { | |
| @Override | |
| public Response intercept(Chain chain) throws IOException { | |
| Request request = chain.request(); | |
| //Build new request | |
| Request.Builder builder = request.newBuilder(); | |
| builder.header("Accept", "application/json"); //if necessary, say to consume JSON | |