RXJS ShareReplay Explained With Examples

Da Feng
4 min readSep 22, 2022
Photo by Elaine Casap on Unsplash

ShareReplay: share source and replay specified number of emissions on subscription.

After reading that, I still don’t know much about it. Probably the most used case we know about ShareReplay is when doing HTTP calls, we can call API once, and use ShareReplay(1) to give the results to other subscribers immediately when they subscribe so that we avoid the extra HTTP calls and make our app more…

--

--

Da Feng

I am a software developer, write blogs about Typescript, Angular, React, vue, Front-end technologies, also share some of my life stories and good memories here.