Created
December 19, 2018 12:58
-
-
Save leocristofani/1f9df8fe861dd6581946068352f15fd8 to your computer and use it in GitHub Desktop.
Micro-frontends in practice - communication between services via custom DOM events - subscribe
This file contains 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
class SongsContainer extends React.Component { | |
componentDidMount() { | |
window.addEventListener(ARTISTS_SELECT_ARTIST, this.fetchSongs); | |
this.fetchSongs({ detail: { artist: this.state.artist } }); | |
} | |
componentWillMount() { | |
window.removeEventListener(ARTISTS_SELECT_ARTIST, this.fetchSongs); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment