{"action":"closed","issue":{"url":"https://api.github.com/repos/akka/akka/issues/19452","repository_url":"https://api.github.com/repos/akka/akka","labels_url":"https://api.github.com/repos/akka/akka/issues/19452/labels{/name}","comments_url":"https://api.github.com/repos/akka/akka/issues/19452/comments","events_url":"https://api.github.com/repos/akka/akka/issues/19452/events","html_url":"https://github.com/akka/akka/issues/19452","id":126656670,"number":19452,"title":"Add `Flow.auto` and `Sink.contramap`.","user":{"login":"aloiscochard","id":215476,"avatar_url":"https://avatars.githubusercontent.com/u/215476?v=3","gravatar_id":"","url":"https://api.github.com/users/aloiscochard","html_url":"https://github.com/aloiscochard","followers_url":"https://api.github.com/users/aloiscochard/followers","following_url":"https://api.github.com/users/aloiscochard/following{/other_user}","gists_url":"https://api.github.com/users/aloiscochard/gists{/gist_id}","starred_url":"https://api.github.com/users/aloiscochard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aloiscochard/subscriptions","organizations_url":"https://api.github.com/users/aloiscochard/orgs","repos_url":"https://api.github.com/users/aloiscochard/repos","events_url":"https://api.github.com/users/aloiscochard/events{/privacy}","received_events_url":"https://api.github.com/users/aloiscochard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/akka/akka/labels/1%20-%20triaged","name":"1 - triaged","color":"5319e7"},{"url":"https://api.github.com/repos/akka/akka/labels/t:stream","name":"t:stream","color":"cccccc"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/akka/akka/milestones/66","html_url":"https://github.com/akka/akka/milestones/2.4.2","labels_url":"https://api.github.com/repos/akka/akka/milestones/66/labels","id":1432396,"number":66,"title":"2.4.2","description":null,"creator":{"login":"ktoso","id":120979,"avatar_url":"https://avatars.githubusercontent.com/u/120979?v=3","gravatar_id":"","url":"https://api.github.com/users/ktoso","html_url":"https://github.com/ktoso","followers_url":"https://api.github.com/users/ktoso/followers","following_url":"https://api.github.com/users/ktoso/following{/other_user}","gists_url":"https://api.github.com/users/ktoso/gists{/gist_id}","starred_url":"https://api.github.com/users/ktoso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ktoso/subscriptions","organizations_url":"https://api.github.com/users/ktoso/orgs","repos_url":"https://api.github.com/users/ktoso/repos","events_url":"https://api.github.com/users/ktoso/events{/privacy}","received_events_url":"https://api.github.com/users/ktoso/received_events","type":"User","site_admin":false},"open_issues":24,"closed_issues":129,"state":"open","created_at":"2015-11-27T12:28:25Z","updated_at":"2016-02-11T16:36:15Z","due_on":null,"closed_at":null},"comments":16,"created_at":"2016-01-14T13:40:09Z","updated_at":"2016-02-11T16:36:15Z","closed_at":"2016-02-11T16:36:15Z","body":"I would like to suggest a few combinators, I already have a PR ready with those:\r\n\r\nFlow.auto (name taken from an other streaming lib I was using, I'm open to a suggestion that fit better the naming scheme of the project)\r\n```\r\n  /**\r\n   * Helper to create `Flow` from a function.\r\n   */\r\n  def auto[A, B](f: A ⇒ B): Flow[A, B, Unit] = apply[A].map(f)\r\n```\r\n\r\nSink.contramap\r\n```\r\n  def contramap[In2](f: In2 ⇒ In): Sink[In2, Mat] = Flow.auto(f).toMat(this) { (_, m) ⇒ m }\r\n```\r\n"}}