Added code example for the stream operator map (#25373)
* Added code example for the stream operator map
This commit is contained in:
parent
4a8368bfe0
commit
1638580339
2 changed files with 26 additions and 0 deletions
19
akka-docs/src/test/scala/docs/stream/operators/Map.scala
Normal file
19
akka-docs/src/test/scala/docs/stream/operators/Map.scala
Normal 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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue