Add yet-another-react-lightbox package and update .gitignore to exclude node_modules
This commit is contained in:
41
frontend/node_modules/redux/src/applyMiddleware.js
generated
vendored
41
frontend/node_modules/redux/src/applyMiddleware.js
generated
vendored
@@ -1,41 +0,0 @@
|
||||
import compose from './compose'
|
||||
|
||||
/**
|
||||
* Creates a store enhancer that applies middleware to the dispatch method
|
||||
* of the Redux store. This is handy for a variety of tasks, such as expressing
|
||||
* asynchronous actions in a concise manner, or logging every action payload.
|
||||
*
|
||||
* See `redux-thunk` package as an example of the Redux middleware.
|
||||
*
|
||||
* Because middleware is potentially asynchronous, this should be the first
|
||||
* store enhancer in the composition chain.
|
||||
*
|
||||
* Note that each middleware will be given the `dispatch` and `getState` functions
|
||||
* as named arguments.
|
||||
*
|
||||
* @param {...Function} middlewares The middleware chain to be applied.
|
||||
* @returns {Function} A store enhancer applying the middleware.
|
||||
*/
|
||||
export default function applyMiddleware(...middlewares) {
|
||||
return (createStore) => (...args) => {
|
||||
const store = createStore(...args)
|
||||
let dispatch = () => {
|
||||
throw new Error(
|
||||
'Dispatching while constructing your middleware is not allowed. ' +
|
||||
'Other middleware would not be applied to this dispatch.'
|
||||
)
|
||||
}
|
||||
|
||||
const middlewareAPI = {
|
||||
getState: store.getState,
|
||||
dispatch: (...args) => dispatch(...args),
|
||||
}
|
||||
const chain = middlewares.map((middleware) => middleware(middlewareAPI))
|
||||
dispatch = compose(...chain)(store.dispatch)
|
||||
|
||||
return {
|
||||
...store,
|
||||
dispatch,
|
||||
}
|
||||
}
|
||||
}
|
||||
52
frontend/node_modules/redux/src/bindActionCreators.js
generated
vendored
52
frontend/node_modules/redux/src/bindActionCreators.js
generated
vendored
@@ -1,52 +0,0 @@
|
||||
import { kindOf } from './utils/kindOf'
|
||||
|
||||
function bindActionCreator(actionCreator, dispatch) {
|
||||
return function () {
|
||||
return dispatch(actionCreator.apply(this, arguments))
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns an object whose values are action creators, into an object with the
|
||||
* same keys, but with every function wrapped into a `dispatch` call so they
|
||||
* may be invoked directly. This is just a convenience method, as you can call
|
||||
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
|
||||
*
|
||||
* For convenience, you can also pass an action creator as the first argument,
|
||||
* and get a dispatch wrapped function in return.
|
||||
*
|
||||
* @param {Function|Object} actionCreators An object whose values are action
|
||||
* creator functions. One handy way to obtain it is to use ES6 `import * as`
|
||||
* syntax. You may also pass a single function.
|
||||
*
|
||||
* @param {Function} dispatch The `dispatch` function available on your Redux
|
||||
* store.
|
||||
*
|
||||
* @returns {Function|Object} The object mimicking the original object, but with
|
||||
* every action creator wrapped into the `dispatch` call. If you passed a
|
||||
* function as `actionCreators`, the return value will also be a single
|
||||
* function.
|
||||
*/
|
||||
export default function bindActionCreators(actionCreators, dispatch) {
|
||||
if (typeof actionCreators === 'function') {
|
||||
return bindActionCreator(actionCreators, dispatch)
|
||||
}
|
||||
|
||||
if (typeof actionCreators !== 'object' || actionCreators === null) {
|
||||
throw new Error(
|
||||
`bindActionCreators expected an object or a function, but instead received: '${kindOf(
|
||||
actionCreators
|
||||
)}'. ` +
|
||||
`Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`
|
||||
)
|
||||
}
|
||||
|
||||
const boundActionCreators = {}
|
||||
for (const key in actionCreators) {
|
||||
const actionCreator = actionCreators[key]
|
||||
if (typeof actionCreator === 'function') {
|
||||
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch)
|
||||
}
|
||||
}
|
||||
return boundActionCreators
|
||||
}
|
||||
175
frontend/node_modules/redux/src/combineReducers.js
generated
vendored
175
frontend/node_modules/redux/src/combineReducers.js
generated
vendored
@@ -1,175 +0,0 @@
|
||||
import ActionTypes from './utils/actionTypes'
|
||||
import warning from './utils/warning'
|
||||
import isPlainObject from './utils/isPlainObject'
|
||||
import { kindOf } from './utils/kindOf'
|
||||
|
||||
function getUnexpectedStateShapeWarningMessage(
|
||||
inputState,
|
||||
reducers,
|
||||
action,
|
||||
unexpectedKeyCache
|
||||
) {
|
||||
const reducerKeys = Object.keys(reducers)
|
||||
const argumentName =
|
||||
action && action.type === ActionTypes.INIT
|
||||
? 'preloadedState argument passed to createStore'
|
||||
: 'previous state received by the reducer'
|
||||
|
||||
if (reducerKeys.length === 0) {
|
||||
return (
|
||||
'Store does not have a valid reducer. Make sure the argument passed ' +
|
||||
'to combineReducers is an object whose values are reducers.'
|
||||
)
|
||||
}
|
||||
|
||||
if (!isPlainObject(inputState)) {
|
||||
return (
|
||||
`The ${argumentName} has unexpected type of "${kindOf(
|
||||
inputState
|
||||
)}". Expected argument to be an object with the following ` +
|
||||
`keys: "${reducerKeys.join('", "')}"`
|
||||
)
|
||||
}
|
||||
|
||||
const unexpectedKeys = Object.keys(inputState).filter(
|
||||
(key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]
|
||||
)
|
||||
|
||||
unexpectedKeys.forEach((key) => {
|
||||
unexpectedKeyCache[key] = true
|
||||
})
|
||||
|
||||
if (action && action.type === ActionTypes.REPLACE) return
|
||||
|
||||
if (unexpectedKeys.length > 0) {
|
||||
return (
|
||||
`Unexpected ${unexpectedKeys.length > 1 ? 'keys' : 'key'} ` +
|
||||
`"${unexpectedKeys.join('", "')}" found in ${argumentName}. ` +
|
||||
`Expected to find one of the known reducer keys instead: ` +
|
||||
`"${reducerKeys.join('", "')}". Unexpected keys will be ignored.`
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function assertReducerShape(reducers) {
|
||||
Object.keys(reducers).forEach((key) => {
|
||||
const reducer = reducers[key]
|
||||
const initialState = reducer(undefined, { type: ActionTypes.INIT })
|
||||
|
||||
if (typeof initialState === 'undefined') {
|
||||
throw new Error(
|
||||
`The slice reducer for key "${key}" returned undefined during initialization. ` +
|
||||
`If the state passed to the reducer is undefined, you must ` +
|
||||
`explicitly return the initial state. The initial state may ` +
|
||||
`not be undefined. If you don't want to set a value for this reducer, ` +
|
||||
`you can use null instead of undefined.`
|
||||
)
|
||||
}
|
||||
|
||||
if (
|
||||
typeof reducer(undefined, {
|
||||
type: ActionTypes.PROBE_UNKNOWN_ACTION(),
|
||||
}) === 'undefined'
|
||||
) {
|
||||
throw new Error(
|
||||
`The slice reducer for key "${key}" returned undefined when probed with a random type. ` +
|
||||
`Don't try to handle '${ActionTypes.INIT}' or other actions in "redux/*" ` +
|
||||
`namespace. They are considered private. Instead, you must return the ` +
|
||||
`current state for any unknown actions, unless it is undefined, ` +
|
||||
`in which case you must return the initial state, regardless of the ` +
|
||||
`action type. The initial state may not be undefined, but can be null.`
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Turns an object whose values are different reducer functions, into a single
|
||||
* reducer function. It will call every child reducer, and gather their results
|
||||
* into a single state object, whose keys correspond to the keys of the passed
|
||||
* reducer functions.
|
||||
*
|
||||
* @param {Object} reducers An object whose values correspond to different
|
||||
* reducer functions that need to be combined into one. One handy way to obtain
|
||||
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
|
||||
* undefined for any action. Instead, they should return their initial state
|
||||
* if the state passed to them was undefined, and the current state for any
|
||||
* unrecognized action.
|
||||
*
|
||||
* @returns {Function} A reducer function that invokes every reducer inside the
|
||||
* passed object, and builds a state object with the same shape.
|
||||
*/
|
||||
export default function combineReducers(reducers) {
|
||||
const reducerKeys = Object.keys(reducers)
|
||||
const finalReducers = {}
|
||||
for (let i = 0; i < reducerKeys.length; i++) {
|
||||
const key = reducerKeys[i]
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
if (typeof reducers[key] === 'undefined') {
|
||||
warning(`No reducer provided for key "${key}"`)
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof reducers[key] === 'function') {
|
||||
finalReducers[key] = reducers[key]
|
||||
}
|
||||
}
|
||||
const finalReducerKeys = Object.keys(finalReducers)
|
||||
|
||||
// This is used to make sure we don't warn about the same
|
||||
// keys multiple times.
|
||||
let unexpectedKeyCache
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
unexpectedKeyCache = {}
|
||||
}
|
||||
|
||||
let shapeAssertionError
|
||||
try {
|
||||
assertReducerShape(finalReducers)
|
||||
} catch (e) {
|
||||
shapeAssertionError = e
|
||||
}
|
||||
|
||||
return function combination(state = {}, action) {
|
||||
if (shapeAssertionError) {
|
||||
throw shapeAssertionError
|
||||
}
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
const warningMessage = getUnexpectedStateShapeWarningMessage(
|
||||
state,
|
||||
finalReducers,
|
||||
action,
|
||||
unexpectedKeyCache
|
||||
)
|
||||
if (warningMessage) {
|
||||
warning(warningMessage)
|
||||
}
|
||||
}
|
||||
|
||||
let hasChanged = false
|
||||
const nextState = {}
|
||||
for (let i = 0; i < finalReducerKeys.length; i++) {
|
||||
const key = finalReducerKeys[i]
|
||||
const reducer = finalReducers[key]
|
||||
const previousStateForKey = state[key]
|
||||
const nextStateForKey = reducer(previousStateForKey, action)
|
||||
if (typeof nextStateForKey === 'undefined') {
|
||||
const actionType = action && action.type
|
||||
throw new Error(
|
||||
`When called with an action of type ${
|
||||
actionType ? `"${String(actionType)}"` : '(unknown type)'
|
||||
}, the slice reducer for key "${key}" returned undefined. ` +
|
||||
`To ignore an action, you must explicitly return the previous state. ` +
|
||||
`If you want this reducer to hold no value, you can return null instead of undefined.`
|
||||
)
|
||||
}
|
||||
nextState[key] = nextStateForKey
|
||||
hasChanged = hasChanged || nextStateForKey !== previousStateForKey
|
||||
}
|
||||
hasChanged =
|
||||
hasChanged || finalReducerKeys.length !== Object.keys(state).length
|
||||
return hasChanged ? nextState : state
|
||||
}
|
||||
}
|
||||
22
frontend/node_modules/redux/src/compose.js
generated
vendored
22
frontend/node_modules/redux/src/compose.js
generated
vendored
@@ -1,22 +0,0 @@
|
||||
/**
|
||||
* Composes single-argument functions from right to left. The rightmost
|
||||
* function can take multiple arguments as it provides the signature for
|
||||
* the resulting composite function.
|
||||
*
|
||||
* @param {...Function} funcs The functions to compose.
|
||||
* @returns {Function} A function obtained by composing the argument functions
|
||||
* from right to left. For example, compose(f, g, h) is identical to doing
|
||||
* (...args) => f(g(h(...args))).
|
||||
*/
|
||||
|
||||
export default function compose(...funcs) {
|
||||
if (funcs.length === 0) {
|
||||
return (arg) => arg
|
||||
}
|
||||
|
||||
if (funcs.length === 1) {
|
||||
return funcs[0]
|
||||
}
|
||||
|
||||
return funcs.reduce((a, b) => (...args) => a(b(...args)))
|
||||
}
|
||||
347
frontend/node_modules/redux/src/createStore.js
generated
vendored
347
frontend/node_modules/redux/src/createStore.js
generated
vendored
@@ -1,347 +0,0 @@
|
||||
import $$observable from './utils/symbol-observable'
|
||||
|
||||
import ActionTypes from './utils/actionTypes'
|
||||
import isPlainObject from './utils/isPlainObject'
|
||||
import { kindOf } from './utils/kindOf'
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*
|
||||
* **We recommend using the `configureStore` method
|
||||
* of the `@reduxjs/toolkit` package**, which replaces `createStore`.
|
||||
*
|
||||
* Redux Toolkit is our recommended approach for writing Redux logic today,
|
||||
* including store setup, reducers, data fetching, and more.
|
||||
*
|
||||
* **For more details, please read this Redux docs page:**
|
||||
* **https://redux.js.org/introduction/why-rtk-is-redux-today**
|
||||
*
|
||||
* `configureStore` from Redux Toolkit is an improved version of `createStore` that
|
||||
* simplifies setup and helps avoid common bugs.
|
||||
*
|
||||
* You should not be using the `redux` core package by itself today, except for learning purposes.
|
||||
* The `createStore` method from the core `redux` package will not be removed, but we encourage
|
||||
* all users to migrate to using Redux Toolkit for all Redux code.
|
||||
*
|
||||
* If you want to use `createStore` without this visual deprecation warning, use
|
||||
* the `legacy_createStore` import instead:
|
||||
*
|
||||
* `import { legacy_createStore as createStore} from 'redux'`
|
||||
*
|
||||
*/
|
||||
export function createStore(reducer, preloadedState, enhancer) {
|
||||
if (
|
||||
(typeof preloadedState === 'function' && typeof enhancer === 'function') ||
|
||||
(typeof enhancer === 'function' && typeof arguments[3] === 'function')
|
||||
) {
|
||||
throw new Error(
|
||||
'It looks like you are passing several store enhancers to ' +
|
||||
'createStore(). This is not supported. Instead, compose them ' +
|
||||
'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.'
|
||||
)
|
||||
}
|
||||
|
||||
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
|
||||
enhancer = preloadedState
|
||||
preloadedState = undefined
|
||||
}
|
||||
|
||||
if (typeof enhancer !== 'undefined') {
|
||||
if (typeof enhancer !== 'function') {
|
||||
throw new Error(
|
||||
`Expected the enhancer to be a function. Instead, received: '${kindOf(
|
||||
enhancer
|
||||
)}'`
|
||||
)
|
||||
}
|
||||
|
||||
return enhancer(createStore)(reducer, preloadedState)
|
||||
}
|
||||
|
||||
if (typeof reducer !== 'function') {
|
||||
throw new Error(
|
||||
`Expected the root reducer to be a function. Instead, received: '${kindOf(
|
||||
reducer
|
||||
)}'`
|
||||
)
|
||||
}
|
||||
|
||||
let currentReducer = reducer
|
||||
let currentState = preloadedState
|
||||
let currentListeners = []
|
||||
let nextListeners = currentListeners
|
||||
let isDispatching = false
|
||||
|
||||
/**
|
||||
* This makes a shallow copy of currentListeners so we can use
|
||||
* nextListeners as a temporary list while dispatching.
|
||||
*
|
||||
* This prevents any bugs around consumers calling
|
||||
* subscribe/unsubscribe in the middle of a dispatch.
|
||||
*/
|
||||
function ensureCanMutateNextListeners() {
|
||||
if (nextListeners === currentListeners) {
|
||||
nextListeners = currentListeners.slice()
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads the state tree managed by the store.
|
||||
*
|
||||
* @returns {any} The current state tree of your application.
|
||||
*/
|
||||
function getState() {
|
||||
if (isDispatching) {
|
||||
throw new Error(
|
||||
'You may not call store.getState() while the reducer is executing. ' +
|
||||
'The reducer has already received the state as an argument. ' +
|
||||
'Pass it down from the top reducer instead of reading it from the store.'
|
||||
)
|
||||
}
|
||||
|
||||
return currentState
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a change listener. It will be called any time an action is dispatched,
|
||||
* and some part of the state tree may potentially have changed. You may then
|
||||
* call `getState()` to read the current state tree inside the callback.
|
||||
*
|
||||
* You may call `dispatch()` from a change listener, with the following
|
||||
* caveats:
|
||||
*
|
||||
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
|
||||
* If you subscribe or unsubscribe while the listeners are being invoked, this
|
||||
* will not have any effect on the `dispatch()` that is currently in progress.
|
||||
* However, the next `dispatch()` call, whether nested or not, will use a more
|
||||
* recent snapshot of the subscription list.
|
||||
*
|
||||
* 2. The listener should not expect to see all state changes, as the state
|
||||
* might have been updated multiple times during a nested `dispatch()` before
|
||||
* the listener is called. It is, however, guaranteed that all subscribers
|
||||
* registered before the `dispatch()` started will be called with the latest
|
||||
* state by the time it exits.
|
||||
*
|
||||
* @param {Function} listener A callback to be invoked on every dispatch.
|
||||
* @returns {Function} A function to remove this change listener.
|
||||
*/
|
||||
function subscribe(listener) {
|
||||
if (typeof listener !== 'function') {
|
||||
throw new Error(
|
||||
`Expected the listener to be a function. Instead, received: '${kindOf(
|
||||
listener
|
||||
)}'`
|
||||
)
|
||||
}
|
||||
|
||||
if (isDispatching) {
|
||||
throw new Error(
|
||||
'You may not call store.subscribe() while the reducer is executing. ' +
|
||||
'If you would like to be notified after the store has been updated, subscribe from a ' +
|
||||
'component and invoke store.getState() in the callback to access the latest state. ' +
|
||||
'See https://redux.js.org/api/store#subscribelistener for more details.'
|
||||
)
|
||||
}
|
||||
|
||||
let isSubscribed = true
|
||||
|
||||
ensureCanMutateNextListeners()
|
||||
nextListeners.push(listener)
|
||||
|
||||
return function unsubscribe() {
|
||||
if (!isSubscribed) {
|
||||
return
|
||||
}
|
||||
|
||||
if (isDispatching) {
|
||||
throw new Error(
|
||||
'You may not unsubscribe from a store listener while the reducer is executing. ' +
|
||||
'See https://redux.js.org/api/store#subscribelistener for more details.'
|
||||
)
|
||||
}
|
||||
|
||||
isSubscribed = false
|
||||
|
||||
ensureCanMutateNextListeners()
|
||||
const index = nextListeners.indexOf(listener)
|
||||
nextListeners.splice(index, 1)
|
||||
currentListeners = null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatches an action. It is the only way to trigger a state change.
|
||||
*
|
||||
* The `reducer` function, used to create the store, will be called with the
|
||||
* current state tree and the given `action`. Its return value will
|
||||
* be considered the **next** state of the tree, and the change listeners
|
||||
* will be notified.
|
||||
*
|
||||
* The base implementation only supports plain object actions. If you want to
|
||||
* dispatch a Promise, an Observable, a thunk, or something else, you need to
|
||||
* wrap your store creating function into the corresponding middleware. For
|
||||
* example, see the documentation for the `redux-thunk` package. Even the
|
||||
* middleware will eventually dispatch plain object actions using this method.
|
||||
*
|
||||
* @param {Object} action A plain object representing “what changed”. It is
|
||||
* a good idea to keep actions serializable so you can record and replay user
|
||||
* sessions, or use the time travelling `redux-devtools`. An action must have
|
||||
* a `type` property which may not be `undefined`. It is a good idea to use
|
||||
* string constants for action types.
|
||||
*
|
||||
* @returns {Object} For convenience, the same action object you dispatched.
|
||||
*
|
||||
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
|
||||
* return something else (for example, a Promise you can await).
|
||||
*/
|
||||
function dispatch(action) {
|
||||
if (!isPlainObject(action)) {
|
||||
throw new Error(
|
||||
`Actions must be plain objects. Instead, the actual type was: '${kindOf(
|
||||
action
|
||||
)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`
|
||||
)
|
||||
}
|
||||
|
||||
if (typeof action.type === 'undefined') {
|
||||
throw new Error(
|
||||
'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'
|
||||
)
|
||||
}
|
||||
|
||||
if (isDispatching) {
|
||||
throw new Error('Reducers may not dispatch actions.')
|
||||
}
|
||||
|
||||
try {
|
||||
isDispatching = true
|
||||
currentState = currentReducer(currentState, action)
|
||||
} finally {
|
||||
isDispatching = false
|
||||
}
|
||||
|
||||
const listeners = (currentListeners = nextListeners)
|
||||
for (let i = 0; i < listeners.length; i++) {
|
||||
const listener = listeners[i]
|
||||
listener()
|
||||
}
|
||||
|
||||
return action
|
||||
}
|
||||
|
||||
/**
|
||||
* Replaces the reducer currently used by the store to calculate the state.
|
||||
*
|
||||
* You might need this if your app implements code splitting and you want to
|
||||
* load some of the reducers dynamically. You might also need this if you
|
||||
* implement a hot reloading mechanism for Redux.
|
||||
*
|
||||
* @param {Function} nextReducer The reducer for the store to use instead.
|
||||
* @returns {void}
|
||||
*/
|
||||
function replaceReducer(nextReducer) {
|
||||
if (typeof nextReducer !== 'function') {
|
||||
throw new Error(
|
||||
`Expected the nextReducer to be a function. Instead, received: '${kindOf(
|
||||
nextReducer
|
||||
)}`
|
||||
)
|
||||
}
|
||||
|
||||
currentReducer = nextReducer
|
||||
|
||||
// This action has a similiar effect to ActionTypes.INIT.
|
||||
// Any reducers that existed in both the new and old rootReducer
|
||||
// will receive the previous state. This effectively populates
|
||||
// the new state tree with any relevant data from the old one.
|
||||
dispatch({ type: ActionTypes.REPLACE })
|
||||
}
|
||||
|
||||
/**
|
||||
* Interoperability point for observable/reactive libraries.
|
||||
* @returns {observable} A minimal observable of state changes.
|
||||
* For more information, see the observable proposal:
|
||||
* https://github.com/tc39/proposal-observable
|
||||
*/
|
||||
function observable() {
|
||||
const outerSubscribe = subscribe
|
||||
return {
|
||||
/**
|
||||
* The minimal observable subscription method.
|
||||
* @param {Object} observer Any object that can be used as an observer.
|
||||
* The observer object should have a `next` method.
|
||||
* @returns {subscription} An object with an `unsubscribe` method that can
|
||||
* be used to unsubscribe the observable from the store, and prevent further
|
||||
* emission of values from the observable.
|
||||
*/
|
||||
subscribe(observer) {
|
||||
if (typeof observer !== 'object' || observer === null) {
|
||||
throw new TypeError(
|
||||
`Expected the observer to be an object. Instead, received: '${kindOf(
|
||||
observer
|
||||
)}'`
|
||||
)
|
||||
}
|
||||
|
||||
function observeState() {
|
||||
if (observer.next) {
|
||||
observer.next(getState())
|
||||
}
|
||||
}
|
||||
|
||||
observeState()
|
||||
const unsubscribe = outerSubscribe(observeState)
|
||||
return { unsubscribe }
|
||||
},
|
||||
|
||||
[$$observable]() {
|
||||
return this
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
// When a store is created, an "INIT" action is dispatched so that every
|
||||
// reducer returns their initial state. This effectively populates
|
||||
// the initial state tree.
|
||||
dispatch({ type: ActionTypes.INIT })
|
||||
|
||||
return {
|
||||
dispatch,
|
||||
subscribe,
|
||||
getState,
|
||||
replaceReducer,
|
||||
[$$observable]: observable,
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a Redux store that holds the state tree.
|
||||
*
|
||||
* **We recommend using `configureStore` from the
|
||||
* `@reduxjs/toolkit` package**, which replaces `createStore`:
|
||||
* **https://redux.js.org/introduction/why-rtk-is-redux-today**
|
||||
*
|
||||
* The only way to change the data in the store is to call `dispatch()` on it.
|
||||
*
|
||||
* There should only be a single store in your app. To specify how different
|
||||
* parts of the state tree respond to actions, you may combine several reducers
|
||||
* into a single reducer function by using `combineReducers`.
|
||||
*
|
||||
* @param {Function} reducer A function that returns the next state tree, given
|
||||
* the current state tree and the action to handle.
|
||||
*
|
||||
* @param {any} [preloadedState] The initial state. You may optionally specify it
|
||||
* to hydrate the state from the server in universal apps, or to restore a
|
||||
* previously serialized user session.
|
||||
* If you use `combineReducers` to produce the root reducer function, this must be
|
||||
* an object with the same shape as `combineReducers` keys.
|
||||
*
|
||||
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
|
||||
* to enhance the store with third-party capabilities such as middleware,
|
||||
* time travel, persistence, etc. The only store enhancer that ships with Redux
|
||||
* is `applyMiddleware()`.
|
||||
*
|
||||
* @returns {Store} A Redux store that lets you read the state, dispatch actions
|
||||
* and subscribe to changes.
|
||||
*/
|
||||
export const legacy_createStore = createStore
|
||||
16
frontend/node_modules/redux/src/index.js
generated
vendored
16
frontend/node_modules/redux/src/index.js
generated
vendored
@@ -1,16 +0,0 @@
|
||||
import { createStore, legacy_createStore } from './createStore'
|
||||
import combineReducers from './combineReducers'
|
||||
import bindActionCreators from './bindActionCreators'
|
||||
import applyMiddleware from './applyMiddleware'
|
||||
import compose from './compose'
|
||||
import __DO_NOT_USE__ActionTypes from './utils/actionTypes'
|
||||
|
||||
export {
|
||||
createStore,
|
||||
legacy_createStore,
|
||||
combineReducers,
|
||||
bindActionCreators,
|
||||
applyMiddleware,
|
||||
compose,
|
||||
__DO_NOT_USE__ActionTypes,
|
||||
}
|
||||
17
frontend/node_modules/redux/src/utils/actionTypes.js
generated
vendored
17
frontend/node_modules/redux/src/utils/actionTypes.js
generated
vendored
@@ -1,17 +0,0 @@
|
||||
/**
|
||||
* These are private action types reserved by Redux.
|
||||
* For any unknown actions, you must return the current state.
|
||||
* If the current state is undefined, you must return the initial state.
|
||||
* Do not reference these action types directly in your code.
|
||||
*/
|
||||
|
||||
const randomString = () =>
|
||||
Math.random().toString(36).substring(7).split('').join('.')
|
||||
|
||||
const ActionTypes = {
|
||||
INIT: `@@redux/INIT${randomString()}`,
|
||||
REPLACE: `@@redux/REPLACE${randomString()}`,
|
||||
PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`,
|
||||
}
|
||||
|
||||
export default ActionTypes
|
||||
15
frontend/node_modules/redux/src/utils/formatProdErrorMessage.js
generated
vendored
15
frontend/node_modules/redux/src/utils/formatProdErrorMessage.js
generated
vendored
@@ -1,15 +0,0 @@
|
||||
/**
|
||||
* Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
|
||||
*
|
||||
* Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
|
||||
* during build.
|
||||
* @param {number} code
|
||||
*/
|
||||
function formatProdErrorMessage(code) {
|
||||
return (
|
||||
`Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or ` +
|
||||
'use the non-minified dev environment for full errors. '
|
||||
)
|
||||
}
|
||||
|
||||
export default formatProdErrorMessage
|
||||
14
frontend/node_modules/redux/src/utils/isPlainObject.js
generated
vendored
14
frontend/node_modules/redux/src/utils/isPlainObject.js
generated
vendored
@@ -1,14 +0,0 @@
|
||||
/**
|
||||
* @param {any} obj The object to inspect.
|
||||
* @returns {boolean} True if the argument appears to be a plain object.
|
||||
*/
|
||||
export default function isPlainObject(obj) {
|
||||
if (typeof obj !== 'object' || obj === null) return false
|
||||
|
||||
let proto = obj
|
||||
while (Object.getPrototypeOf(proto) !== null) {
|
||||
proto = Object.getPrototypeOf(proto)
|
||||
}
|
||||
|
||||
return Object.getPrototypeOf(obj) === proto
|
||||
}
|
||||
70
frontend/node_modules/redux/src/utils/kindOf.js
generated
vendored
70
frontend/node_modules/redux/src/utils/kindOf.js
generated
vendored
@@ -1,70 +0,0 @@
|
||||
// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
|
||||
function miniKindOf(val) {
|
||||
if (val === void 0) return 'undefined'
|
||||
if (val === null) return 'null'
|
||||
|
||||
const type = typeof val
|
||||
switch (type) {
|
||||
case 'boolean':
|
||||
case 'string':
|
||||
case 'number':
|
||||
case 'symbol':
|
||||
case 'function': {
|
||||
return type
|
||||
}
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
if (Array.isArray(val)) return 'array'
|
||||
if (isDate(val)) return 'date'
|
||||
if (isError(val)) return 'error'
|
||||
|
||||
const constructorName = ctorName(val)
|
||||
switch (constructorName) {
|
||||
case 'Symbol':
|
||||
case 'Promise':
|
||||
case 'WeakMap':
|
||||
case 'WeakSet':
|
||||
case 'Map':
|
||||
case 'Set':
|
||||
return constructorName
|
||||
default:
|
||||
break
|
||||
}
|
||||
|
||||
// other
|
||||
return type.slice(8, -1).toLowerCase().replace(/\s/g, '')
|
||||
}
|
||||
|
||||
function ctorName(val) {
|
||||
return typeof val.constructor === 'function' ? val.constructor.name : null
|
||||
}
|
||||
|
||||
function isError(val) {
|
||||
return (
|
||||
val instanceof Error ||
|
||||
(typeof val.message === 'string' &&
|
||||
val.constructor &&
|
||||
typeof val.constructor.stackTraceLimit === 'number')
|
||||
)
|
||||
}
|
||||
|
||||
function isDate(val) {
|
||||
if (val instanceof Date) return true
|
||||
return (
|
||||
typeof val.toDateString === 'function' &&
|
||||
typeof val.getDate === 'function' &&
|
||||
typeof val.setDate === 'function'
|
||||
)
|
||||
}
|
||||
|
||||
export function kindOf(val) {
|
||||
let typeOfVal = typeof val
|
||||
|
||||
if (process.env.NODE_ENV !== 'production') {
|
||||
typeOfVal = miniKindOf(val)
|
||||
}
|
||||
|
||||
return typeOfVal
|
||||
}
|
||||
3
frontend/node_modules/redux/src/utils/symbol-observable.js
generated
vendored
3
frontend/node_modules/redux/src/utils/symbol-observable.js
generated
vendored
@@ -1,3 +0,0 @@
|
||||
// Inlined version of the `symbol-observable` polyfill
|
||||
export default (() =>
|
||||
(typeof Symbol === 'function' && Symbol.observable) || '@@observable')()
|
||||
19
frontend/node_modules/redux/src/utils/warning.js
generated
vendored
19
frontend/node_modules/redux/src/utils/warning.js
generated
vendored
@@ -1,19 +0,0 @@
|
||||
/**
|
||||
* Prints a warning in the console if it exists.
|
||||
*
|
||||
* @param {String} message The warning message.
|
||||
* @returns {void}
|
||||
*/
|
||||
export default function warning(message) {
|
||||
/* eslint-disable no-console */
|
||||
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
||||
console.error(message)
|
||||
}
|
||||
/* eslint-enable no-console */
|
||||
try {
|
||||
// This error was thrown as a convenience so that if you enable
|
||||
// "break on all exceptions" in your console,
|
||||
// it would pause the execution at this line.
|
||||
throw new Error(message)
|
||||
} catch (e) {} // eslint-disable-line no-empty
|
||||
}
|
||||
Reference in New Issue
Block a user