Added code example for the stream operator map (#25373)

* Added code example for the stream operator map
This commit is contained in:
Gordon Cheung 2018-07-19 09:15:17 +02:00 committed by Christopher Batey
parent 4a8368bfe0
commit 1638580339
2 changed files with 26 additions and 0 deletions

View file

@ -0,0 +1,19 @@
/*
* Copyright (C) 2018 Lightbend Inc. <https://www.lightbend.com>
*/
package docs.stream.operators
//#imports
import akka.NotUsed
import akka.stream.scaladsl._
//#imports
object Map {
//#map
val source: Source[Int, NotUsed] = Source(1 to 10)
val mapped: Source[String, NotUsed] = source.map(elem elem.toString)
//#map
}