From e3a4bc2f4d170f3ff9b433ae36134593c876e1c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Garci=CC=81a?= Date: Mon, 22 Jun 2015 01:55:38 +0200 Subject: [PATCH] little corrections --- .../Contents.swift | 21 ++++++++++++------- .../Contents.swift | 10 ++++----- 2 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Playgrounds/ObservablesOperators/Observables+Creating.playground/Contents.swift b/Playgrounds/ObservablesOperators/Observables+Creating.playground/Contents.swift index 1a34ed66..e32ab420 100644 --- a/Playgrounds/ObservablesOperators/Observables+Creating.playground/Contents.swift +++ b/Playgrounds/ObservablesOperators/Observables+Creating.playground/Contents.swift @@ -182,7 +182,12 @@ example("create") { observable >- subscribeNext { println($0) - } + } + + observable + >- subscribeNext { + println($0) + } } @@ -196,7 +201,7 @@ Create an Observable from a function which create an observable. But do not crea example("defer") { - let defered: Observable = defer({ + let defered: Observable = defer { println("creating") return create { observer in println("emmiting") @@ -206,17 +211,17 @@ example("defer") { return AnonymousDisposable {} } - }) - - defered - >- subscribeNext { - println($0) } defered >- subscribeNext { println($0) - } + } + + defered + >- subscribeNext { + println($0) + } } diff --git a/Playgrounds/ObservablesOperators/Observables+Transforming.playground/Contents.swift b/Playgrounds/ObservablesOperators/Observables+Transforming.playground/Contents.swift index 5bff78ed..1536e779 100644 --- a/Playgrounds/ObservablesOperators/Observables+Transforming.playground/Contents.swift +++ b/Playgrounds/ObservablesOperators/Observables+Transforming.playground/Contents.swift @@ -12,7 +12,7 @@ Operators that transform items that are emitted by an Observable. /*: ### `map` / `select` -transform the items emitted by an Observable into Observables, then flatten the emissions from those into a single Observable +Transform the items emitted by an Observable by applying a function to each item [More info in reactive.io website]( http://reactivex.io/documentation/operators/map.html ) */ @@ -30,15 +30,15 @@ example("map") { >- map { char in char.hashValue } - >- subscribeNext { - println($0) + >- subscribeNext { int in + println(int) } } /*: ### `flatMap` -transform the items emitted by an Observable into Observables, then flatten the emissions from those into a single Observable +Transform the items emitted by an Observable into Observables, then flatten the emissions from those into a single Observable [More info in reactive.io website]( http://reactivex.io/documentation/operators/flatmap.html ) */ @@ -75,7 +75,7 @@ example("flatMap") { /*: ### `scan` -apply a function to each item emitted by an Observable, sequentially, and emit each successive value +Apply a function to each item emitted by an Observable, sequentially, and emit each successive value [More info in reactive.io website]( http://reactivex.io/documentation/operators/scan.html ) */