function shareReplayOperator(bufferSize, windowTime, scheduler) {
        var subject
        var refCount = 0
        var subscription
        var hasError = false
        var isComplete = false
        return function shareReplayOperation(source) {
          refCount++
          if (!subject || hasError) {
            hasError = false
            subject = new __WEBPACK_IMPORTED_MODULE_0__ReplaySubject__['a' /* ReplaySubject */](
              bufferSize,
              windowTime,
              scheduler
            )
            subscription = source.subscribe({
              next: function(value) {
                subject.next(value)
              },
              error: function(err) {
                hasError = true
                subject.error(err)
              },
              complete: function() {
                isComplete = true
                subject.complete()
              }
            })
          }
          var innerSub = subject.subscribe(this)
          return function() {
            refCount--
            innerSub.unsubscribe()
            if (subscription && refCount === 0 && isComplete) {
              subscription.unsubscribe()
            }
          }
        }
      }
Turn async functions into promises and backward compatible with callback

@param {Function} $$__fn__$$
@return {Function}
@api public