Skip to content

Instantly share code, notes, and snippets.

@michael-mckenna
Created June 4, 2021 18:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michael-mckenna/cde3fe5383307ae39461804c2fcb61ef to your computer and use it in GitHub Desktop.
Save michael-mckenna/cde3fe5383307ae39461804c2fcb61ef to your computer and use it in GitHub Desktop.
/**
* Updatess the corresponding channel's name. Triggers change detection by returning a new array.
* @param channel channel with updated name
*/
updateChannel(channel: Channel) {
this.channels = this.channels.map(c => c.id === channel.id ? {...c, name: channel.name} : {...c});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment