Created
August 9, 2019 02:17
-
-
Save rbalicki2/9c55db9567f4b3a75344577f445f53a5 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
{ | |
search_api_call_opt.as_ref().map(|ref mut search_api_call| { | |
match &mut *search_api_call.borrow_mut() { | |
PromiseState::Success(search_results) => { | |
let search_results = search_results.clone(); | |
render_search_results(search_results, |track_id| { | |
page.go_to_detail_view(track_id); | |
}) | |
}, | |
PromiseState::Pending => smd!(<p>Loading</p>), | |
PromiseState::Error(_) => smd!(<p>Something went wrong</p>), | |
} | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment