Grabbed dndbeyond's source code

```
~/go/bin/sourcemapper -output ddb -jsurl https://media.dndbeyond.com/character-app/static/js/main.90aa78c5.js
```
This commit is contained in:
2025-05-28 11:50:03 -07:00
commit 8df9031d27
3592 changed files with 319051 additions and 0 deletions
@@ -0,0 +1,52 @@
import { applyMiddleware, createStore, Reducer, Store } from "redux";
import { composeWithDevTools } from "redux-devtools-extension";
import createSagaMiddleware from "redux-saga";
import {
defaultSaga,
ApiAdapterException,
OverrideApiException,
} from "@dndbeyond/character-rules-engine/es";
import { rollResultSaga } from "../sagas";
import { AppLoggerUtils } from "../utils";
let store: Store | null = null;
export function getAppStore(): Store | null {
return store;
}
export function configureStore(
initialState: any,
rootReducer: Reducer,
sagaMiddleware: Array<any> = [],
middleware: Array<any> = []
): Store {
const storeSagaMiddleware = createSagaMiddleware({
onError: (error, errorInfo) => {
// ApiAdapterException errors are handled by the AppApiAdapter
if (!(error instanceof ApiAdapterException)) {
AppLoggerUtils.logError(error);
}
},
});
let storeMiddleware: Array<any> = [];
storeMiddleware.push(...middleware);
storeMiddleware.push(storeSagaMiddleware);
store = createStore(
rootReducer,
initialState,
composeWithDevTools(applyMiddleware(...storeMiddleware))
);
storeSagaMiddleware.run(defaultSaga);
storeSagaMiddleware.run(rollResultSaga);
for (let i = 0; i < sagaMiddleware.length; i++) {
storeSagaMiddleware.run(sagaMiddleware[i]);
}
return store;
}