Last active
August 5, 2017 06:06
-
-
Save brushbox/739e166ab3f42b2b48a1014bfa649528 to your computer and use it in GitHub Desktop.
reducer pipeline snippets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
user_token | |
|> find_user_by_token | |
|> fetch("/messages/unread") | |
|> parse_json_to_message_list | |
|> Enum.each(&save_message(&1)) | |
Enum.each( | |
parse_json_to_message_list( | |
fetch(find_user_by_token(user_token), "/messages/unread") | |
), &save_message(&1)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
points | |
.map { |point| flood_fill(point, continent_id) } | |
.compact | |
.reduce([], &:+) | |
.uniq |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment