Created
June 11, 2019 19:49
-
-
Save adrianparvino/f6adc96b773799e16d042f10ce2f104f to your computer and use it in GitHub Desktop.
This file contains hidden or 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
index = Enum.find_index(threads, &(selected == &1)) | |
if index == length threads - 1 do | |
model | |
else | |
Map.replace!(model, :selected, Enum.at(threads, index + 1)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment