1×
Become a member
to unlock all features
Autoplay

    Share RxJS Streams to Avoid Multiple Requests in Vue.js

    vueVue.js
    ^2.5.13
    rxjsRxJS
    5.5.12 - 6.4.0

    Splitting a stream into multiple streams causes new subscriptions. You can think of new subscriptions as "invoking a function". So if your original stream makes a request for data, splitting the original stream will make 2 requests for data. The way to get around this is by using share so that each time the stream is split, all the split stream stay synced together.