Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
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