PageSourceSearch

https://app.order.co/assets/split_cart/cart_component/store-6f1a41…73b9b1babc431273f673682d7da5117067aaad45.js

js order.co collected 2026-10-02 03:45:50 UTC 1,282 bytes, 46 lines download raw bytes

1const initDevTools = () => {
2  const env = document.querySelector("meta[name='env']");
3  if (env && env.content === "development") {
4    /* eslint-disable no-underscore-dangle */
5    return (
6      window.__REDUX_DEVTOOLS_EXTENSION__ &&
7      window.__REDUX_DEVTOOLS_EXTENSION__.connect({ name: "CartStore" })
8    );
9    /* eslint-enable no-underscore-dangle */
10  }
11  return null;
12};
13
14export const createStore = (reducer, initialState = {}) => {
15  let state = initialState;
16  const listeners = new Set();
17  const devTools = initDevTools();
18
19  const dispatch = (action) => {
20    const prevState = state;
21    const newState = reducer(state, action);
22
23    if (devTools) devTools.send(action, newState);
24
25    listeners.forEach((listener) => listener(prevState, newState));
26    state = newState;
27  };
28
29  const subscribe = (listener) => {
30    listeners.add(listener);
31    return () => listeners.delete(listener);
32  };
33
34  if (devTools) {
35    devTools.init(state);
36    // This enables time travel debugging in Redux DevTools
37    devTools.subscribe(({ type, state: nextState }) => {
38      if (type === "DISPATCH" && nextState) {
39        state = JSON.parse(nextState);
40        listeners.forEach((listener) => listener(state, state));
41      }
42    });
43  }
44
45  return { dispatch, subscribe };
46};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.