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
import RxSwift | |
import RxTest | |
import XCTest | |
@testable import ExampleFramework | |
final class MoviesDefaultViewModelTests: XCTestCase { | |
private var scheduler: TestScheduler! | |
private var observer: TestableObserver<MovieViewState>! | |
private var disposeBag: DisposeBag! |
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
import RxSwift | |
public final class MoviesDefaultViewModel: MoviesViewModel { | |
private let viewStateSubject = BehaviorSubject<MovieViewState>(value: .loading) | |
private let disposeBag = DisposeBag() | |
private let repository: MoviesRepository | |
public init(repository: MoviesRepository) { | |
self.repository = repository | |
} |
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
import RxSwift | |
public enum MovieViewState: Hashable { | |
case loading | |
case error(error: Error) | |
case showingMovies(titles: [String]) | |
case empty | |
public var hashValue: Int { | |
switch self { |
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
final class ThreadWithRunLoopScheduler: ImmediateSchedulerType { | |
private let thread: ThreadWithRunLoop | |
init(name: String) { | |
thread = ThreadWithRunLoop() | |
thread.name = name | |
thread.start() | |
} | |
func schedule<StateType>(_ state: StateType, action: @escaping (StateType) -> Disposable) -> Disposable { |
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
final class ThreadWithRunLoop: Thread { | |
var runLoop: RunLoop! | |
override func main() { | |
runLoop = RunLoop.current | |
runLoop.add(Port(), forMode: .commonModes) | |
runLoop.run() | |
} | |
} |
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
let realmQueue = DispatchQueue(label: "RealmQueue", qos: .background) | |
let realmScheduler = SerialDispatchQueueScheduler(queue: realmQueue, internalSerialQueueName: "RealmScheduler") |
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
func example() -> Single<String> { | |
let cache = MemoryCacheLevel() | |
.compose(DiskCacheLevel<GithubService, NSData>()) | |
.compose(MoyaFetcher(provider: provider)) | |
return cache.get(GithubService.zen) | |
.asObservable() | |
.map { data -> String in | |
guard let string = String(data: data as Data, encoding: .utf8) else { | |
throw MappingError.string(data) |
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
<a id="url_install" href="itms-services://?action=download-manifest&url=https://ios.agilepromoter.com.br/_replace_me_/manifest.plist"> | |
<script type="text/javascript"> | |
window.onload = function() { | |
var path = window.location.pathname; | |
path = path.substring(1, path.length - 1); | |
var linkElement = document.getElementById("url_install"); | |
var iOSURL = linkElement.getAttribute("href") | |
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
var restify = require('restify'); | |
var MongoClient = require('mongodb').MongoClient; | |
var passport = require('passport'); | |
var Strategy = require('passport-http').BasicStrategy; | |
var server = restify.createServer(); | |
var db; | |
passport.use(new Strategy( | |
function(username, password, done) { |
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
*.pbxuser | |
!default.pbxuser | |
*.mode1v3 | |
!default.mode1v3 | |
*.mode2v3 | |
!default.mode2v3 | |
*.perspectivev3 | |
!default.perspectivev3 | |
xcuserdata | |
build |
NewerOlder