Skip to content

Instantly share code, notes, and snippets.

@shangyilim
Created January 14, 2018 05:03
Show Gist options
  • Save shangyilim/45917628392454c60ca53934093115b7 to your computer and use it in GitHub Desktop.
Save shangyilim/45917628392454c60ca53934093115b7 to your computer and use it in GitHub Desktop.
// Subscribe to the latest stream that contains both
// California and Colorado.
californiaOrColorado$.subscribe((result) => {
// Output to UI.
var citiesEle = document.getElementById('cities');
result.forEach(city => {
var itemEle = document.createElement("li");
itemEle.textContent = city.name;
citiesEle.appendChild(itemEle);
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment