Skip to content

Instantly share code, notes, and snippets.

View Athosone's full-sized avatar

WERCK Ayrton Athosone

  • Lyon, France
View GitHub Profile
@Athosone
Athosone / RxSwift+fromAsync.swift
Last active October 2, 2018 17:36
RxSwift+fromAsync example
// Consider this function:
func fetchPost(by postId: Int, completion: @escaping (Post?, Error?) -> Void) {
...
}
// Using our extension to use an observable
// fetchPostObservable looks like: fetchPostObservable(postId) -> Observable<Post>
let fetchPostObservable = Observable.fromAsync(postService.getPost(postId:completion:))
// Now to fetch a post you just have to call it just like you would call any function which returns an Observable:
fecthPostObservable(10).subscribe(onNext: { (post) in
@Athosone
Athosone / Den-of-Clojure-intro-1-talk.md
Created October 17, 2024 09:37 — forked from fouric/Den-of-Clojure-intro-1-talk.md
Den of Clojure - Intro to Clojure part 1

A gentle introduction to Clojure

Lisp Cycles (XKCD 297 / https://xkcd.com/297/)

Ian Truslove

Den of Clojure

2016-04-21