const d = (u) => (s, b, t) => {
  const S = t.subscribe;
  return t.subscribe = (c, l, i) => {
    let r = c;
    if (l) {
      const a = i?.equalityFn || Object.is;
      let e = c(t.getState());
      r = (f) => {
        const n = c(f);
        if (!a(e, n)) {
          const o = e;
          l(e = n, o);
        }
      }, i?.fireImmediately && l(e, e);
    }
    return S(r);
  }, u(s, b, t);
}, v = d;
export {
  v as subscribeWithSelector
};
//# sourceMappingURL=middleware.js.map
