Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-inclu.../js/dist
File: data.js
* @returns {observable} A minimal observable of state changes.
[1000] Fix | Delete
* For more information, see the observable proposal:
[1001] Fix | Delete
* https://github.com/tc39/proposal-observable
[1002] Fix | Delete
*/
[1003] Fix | Delete
[1004] Fix | Delete
[1005] Fix | Delete
function observable() {
[1006] Fix | Delete
var _ref;
[1007] Fix | Delete
[1008] Fix | Delete
var outerSubscribe = subscribe;
[1009] Fix | Delete
return _ref = {
[1010] Fix | Delete
/**
[1011] Fix | Delete
* The minimal observable subscription method.
[1012] Fix | Delete
* @param {Object} observer Any object that can be used as an observer.
[1013] Fix | Delete
* The observer object should have a `next` method.
[1014] Fix | Delete
* @returns {subscription} An object with an `unsubscribe` method that can
[1015] Fix | Delete
* be used to unsubscribe the observable from the store, and prevent further
[1016] Fix | Delete
* emission of values from the observable.
[1017] Fix | Delete
*/
[1018] Fix | Delete
subscribe: function subscribe(observer) {
[1019] Fix | Delete
if (typeof observer !== 'object' || observer === null) {
[1020] Fix | Delete
throw new Error( true ? formatProdErrorMessage(11) : 0);
[1021] Fix | Delete
}
[1022] Fix | Delete
[1023] Fix | Delete
function observeState() {
[1024] Fix | Delete
if (observer.next) {
[1025] Fix | Delete
observer.next(getState());
[1026] Fix | Delete
}
[1027] Fix | Delete
}
[1028] Fix | Delete
[1029] Fix | Delete
observeState();
[1030] Fix | Delete
var unsubscribe = outerSubscribe(observeState);
[1031] Fix | Delete
return {
[1032] Fix | Delete
unsubscribe: unsubscribe
[1033] Fix | Delete
};
[1034] Fix | Delete
}
[1035] Fix | Delete
}, _ref[$$observable] = function () {
[1036] Fix | Delete
return this;
[1037] Fix | Delete
}, _ref;
[1038] Fix | Delete
} // When a store is created, an "INIT" action is dispatched so that every
[1039] Fix | Delete
// reducer returns their initial state. This effectively populates
[1040] Fix | Delete
// the initial state tree.
[1041] Fix | Delete
[1042] Fix | Delete
[1043] Fix | Delete
dispatch({
[1044] Fix | Delete
type: ActionTypes.INIT
[1045] Fix | Delete
});
[1046] Fix | Delete
return _ref2 = {
[1047] Fix | Delete
dispatch: dispatch,
[1048] Fix | Delete
subscribe: subscribe,
[1049] Fix | Delete
getState: getState,
[1050] Fix | Delete
replaceReducer: replaceReducer
[1051] Fix | Delete
}, _ref2[$$observable] = observable, _ref2;
[1052] Fix | Delete
}
[1053] Fix | Delete
/**
[1054] Fix | Delete
* Creates a Redux store that holds the state tree.
[1055] Fix | Delete
*
[1056] Fix | Delete
* **We recommend using `configureStore` from the
[1057] Fix | Delete
* `@reduxjs/toolkit` package**, which replaces `createStore`:
[1058] Fix | Delete
* **https://redux.js.org/introduction/why-rtk-is-redux-today**
[1059] Fix | Delete
*
[1060] Fix | Delete
* The only way to change the data in the store is to call `dispatch()` on it.
[1061] Fix | Delete
*
[1062] Fix | Delete
* There should only be a single store in your app. To specify how different
[1063] Fix | Delete
* parts of the state tree respond to actions, you may combine several reducers
[1064] Fix | Delete
* into a single reducer function by using `combineReducers`.
[1065] Fix | Delete
*
[1066] Fix | Delete
* @param {Function} reducer A function that returns the next state tree, given
[1067] Fix | Delete
* the current state tree and the action to handle.
[1068] Fix | Delete
*
[1069] Fix | Delete
* @param {any} [preloadedState] The initial state. You may optionally specify it
[1070] Fix | Delete
* to hydrate the state from the server in universal apps, or to restore a
[1071] Fix | Delete
* previously serialized user session.
[1072] Fix | Delete
* If you use `combineReducers` to produce the root reducer function, this must be
[1073] Fix | Delete
* an object with the same shape as `combineReducers` keys.
[1074] Fix | Delete
*
[1075] Fix | Delete
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
[1076] Fix | Delete
* to enhance the store with third-party capabilities such as middleware,
[1077] Fix | Delete
* time travel, persistence, etc. The only store enhancer that ships with Redux
[1078] Fix | Delete
* is `applyMiddleware()`.
[1079] Fix | Delete
*
[1080] Fix | Delete
* @returns {Store} A Redux store that lets you read the state, dispatch actions
[1081] Fix | Delete
* and subscribe to changes.
[1082] Fix | Delete
*/
[1083] Fix | Delete
[1084] Fix | Delete
var legacy_createStore = (/* unused pure expression or super */ null && (createStore));
[1085] Fix | Delete
[1086] Fix | Delete
/**
[1087] Fix | Delete
* Prints a warning in the console if it exists.
[1088] Fix | Delete
*
[1089] Fix | Delete
* @param {String} message The warning message.
[1090] Fix | Delete
* @returns {void}
[1091] Fix | Delete
*/
[1092] Fix | Delete
function warning(message) {
[1093] Fix | Delete
/* eslint-disable no-console */
[1094] Fix | Delete
if (typeof console !== 'undefined' && typeof console.error === 'function') {
[1095] Fix | Delete
console.error(message);
[1096] Fix | Delete
}
[1097] Fix | Delete
/* eslint-enable no-console */
[1098] Fix | Delete
[1099] Fix | Delete
[1100] Fix | Delete
try {
[1101] Fix | Delete
// This error was thrown as a convenience so that if you enable
[1102] Fix | Delete
// "break on all exceptions" in your console,
[1103] Fix | Delete
// it would pause the execution at this line.
[1104] Fix | Delete
throw new Error(message);
[1105] Fix | Delete
} catch (e) {} // eslint-disable-line no-empty
[1106] Fix | Delete
[1107] Fix | Delete
}
[1108] Fix | Delete
[1109] Fix | Delete
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
[1110] Fix | Delete
var reducerKeys = Object.keys(reducers);
[1111] Fix | Delete
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
[1112] Fix | Delete
[1113] Fix | Delete
if (reducerKeys.length === 0) {
[1114] Fix | Delete
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
[1115] Fix | Delete
}
[1116] Fix | Delete
[1117] Fix | Delete
if (!isPlainObject(inputState)) {
[1118] Fix | Delete
return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
[1119] Fix | Delete
}
[1120] Fix | Delete
[1121] Fix | Delete
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
[1122] Fix | Delete
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
[1123] Fix | Delete
});
[1124] Fix | Delete
unexpectedKeys.forEach(function (key) {
[1125] Fix | Delete
unexpectedKeyCache[key] = true;
[1126] Fix | Delete
});
[1127] Fix | Delete
if (action && action.type === ActionTypes.REPLACE) return;
[1128] Fix | Delete
[1129] Fix | Delete
if (unexpectedKeys.length > 0) {
[1130] Fix | Delete
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.");
[1131] Fix | Delete
}
[1132] Fix | Delete
}
[1133] Fix | Delete
[1134] Fix | Delete
function assertReducerShape(reducers) {
[1135] Fix | Delete
Object.keys(reducers).forEach(function (key) {
[1136] Fix | Delete
var reducer = reducers[key];
[1137] Fix | Delete
var initialState = reducer(undefined, {
[1138] Fix | Delete
type: ActionTypes.INIT
[1139] Fix | Delete
});
[1140] Fix | Delete
[1141] Fix | Delete
if (typeof initialState === 'undefined') {
[1142] Fix | Delete
throw new Error( true ? formatProdErrorMessage(12) : 0);
[1143] Fix | Delete
}
[1144] Fix | Delete
[1145] Fix | Delete
if (typeof reducer(undefined, {
[1146] Fix | Delete
type: ActionTypes.PROBE_UNKNOWN_ACTION()
[1147] Fix | Delete
}) === 'undefined') {
[1148] Fix | Delete
throw new Error( true ? formatProdErrorMessage(13) : 0);
[1149] Fix | Delete
}
[1150] Fix | Delete
});
[1151] Fix | Delete
}
[1152] Fix | Delete
/**
[1153] Fix | Delete
* Turns an object whose values are different reducer functions, into a single
[1154] Fix | Delete
* reducer function. It will call every child reducer, and gather their results
[1155] Fix | Delete
* into a single state object, whose keys correspond to the keys of the passed
[1156] Fix | Delete
* reducer functions.
[1157] Fix | Delete
*
[1158] Fix | Delete
* @param {Object} reducers An object whose values correspond to different
[1159] Fix | Delete
* reducer functions that need to be combined into one. One handy way to obtain
[1160] Fix | Delete
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
[1161] Fix | Delete
* undefined for any action. Instead, they should return their initial state
[1162] Fix | Delete
* if the state passed to them was undefined, and the current state for any
[1163] Fix | Delete
* unrecognized action.
[1164] Fix | Delete
*
[1165] Fix | Delete
* @returns {Function} A reducer function that invokes every reducer inside the
[1166] Fix | Delete
* passed object, and builds a state object with the same shape.
[1167] Fix | Delete
*/
[1168] Fix | Delete
[1169] Fix | Delete
[1170] Fix | Delete
function combineReducers(reducers) {
[1171] Fix | Delete
var reducerKeys = Object.keys(reducers);
[1172] Fix | Delete
var finalReducers = {};
[1173] Fix | Delete
[1174] Fix | Delete
for (var i = 0; i < reducerKeys.length; i++) {
[1175] Fix | Delete
var key = reducerKeys[i];
[1176] Fix | Delete
[1177] Fix | Delete
if (false) {}
[1178] Fix | Delete
[1179] Fix | Delete
if (typeof reducers[key] === 'function') {
[1180] Fix | Delete
finalReducers[key] = reducers[key];
[1181] Fix | Delete
}
[1182] Fix | Delete
}
[1183] Fix | Delete
[1184] Fix | Delete
var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
[1185] Fix | Delete
// keys multiple times.
[1186] Fix | Delete
[1187] Fix | Delete
var unexpectedKeyCache;
[1188] Fix | Delete
[1189] Fix | Delete
if (false) {}
[1190] Fix | Delete
[1191] Fix | Delete
var shapeAssertionError;
[1192] Fix | Delete
[1193] Fix | Delete
try {
[1194] Fix | Delete
assertReducerShape(finalReducers);
[1195] Fix | Delete
} catch (e) {
[1196] Fix | Delete
shapeAssertionError = e;
[1197] Fix | Delete
}
[1198] Fix | Delete
[1199] Fix | Delete
return function combination(state, action) {
[1200] Fix | Delete
if (state === void 0) {
[1201] Fix | Delete
state = {};
[1202] Fix | Delete
}
[1203] Fix | Delete
[1204] Fix | Delete
if (shapeAssertionError) {
[1205] Fix | Delete
throw shapeAssertionError;
[1206] Fix | Delete
}
[1207] Fix | Delete
[1208] Fix | Delete
if (false) { var warningMessage; }
[1209] Fix | Delete
[1210] Fix | Delete
var hasChanged = false;
[1211] Fix | Delete
var nextState = {};
[1212] Fix | Delete
[1213] Fix | Delete
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
[1214] Fix | Delete
var _key = finalReducerKeys[_i];
[1215] Fix | Delete
var reducer = finalReducers[_key];
[1216] Fix | Delete
var previousStateForKey = state[_key];
[1217] Fix | Delete
var nextStateForKey = reducer(previousStateForKey, action);
[1218] Fix | Delete
[1219] Fix | Delete
if (typeof nextStateForKey === 'undefined') {
[1220] Fix | Delete
var actionType = action && action.type;
[1221] Fix | Delete
throw new Error( true ? formatProdErrorMessage(14) : 0);
[1222] Fix | Delete
}
[1223] Fix | Delete
[1224] Fix | Delete
nextState[_key] = nextStateForKey;
[1225] Fix | Delete
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
[1226] Fix | Delete
}
[1227] Fix | Delete
[1228] Fix | Delete
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
[1229] Fix | Delete
return hasChanged ? nextState : state;
[1230] Fix | Delete
};
[1231] Fix | Delete
}
[1232] Fix | Delete
[1233] Fix | Delete
function bindActionCreator(actionCreator, dispatch) {
[1234] Fix | Delete
return function () {
[1235] Fix | Delete
return dispatch(actionCreator.apply(this, arguments));
[1236] Fix | Delete
};
[1237] Fix | Delete
}
[1238] Fix | Delete
/**
[1239] Fix | Delete
* Turns an object whose values are action creators, into an object with the
[1240] Fix | Delete
* same keys, but with every function wrapped into a `dispatch` call so they
[1241] Fix | Delete
* may be invoked directly. This is just a convenience method, as you can call
[1242] Fix | Delete
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
[1243] Fix | Delete
*
[1244] Fix | Delete
* For convenience, you can also pass an action creator as the first argument,
[1245] Fix | Delete
* and get a dispatch wrapped function in return.
[1246] Fix | Delete
*
[1247] Fix | Delete
* @param {Function|Object} actionCreators An object whose values are action
[1248] Fix | Delete
* creator functions. One handy way to obtain it is to use ES6 `import * as`
[1249] Fix | Delete
* syntax. You may also pass a single function.
[1250] Fix | Delete
*
[1251] Fix | Delete
* @param {Function} dispatch The `dispatch` function available on your Redux
[1252] Fix | Delete
* store.
[1253] Fix | Delete
*
[1254] Fix | Delete
* @returns {Function|Object} The object mimicking the original object, but with
[1255] Fix | Delete
* every action creator wrapped into the `dispatch` call. If you passed a
[1256] Fix | Delete
* function as `actionCreators`, the return value will also be a single
[1257] Fix | Delete
* function.
[1258] Fix | Delete
*/
[1259] Fix | Delete
[1260] Fix | Delete
[1261] Fix | Delete
function bindActionCreators(actionCreators, dispatch) {
[1262] Fix | Delete
if (typeof actionCreators === 'function') {
[1263] Fix | Delete
return bindActionCreator(actionCreators, dispatch);
[1264] Fix | Delete
}
[1265] Fix | Delete
[1266] Fix | Delete
if (typeof actionCreators !== 'object' || actionCreators === null) {
[1267] Fix | Delete
throw new Error( true ? formatProdErrorMessage(16) : 0);
[1268] Fix | Delete
}
[1269] Fix | Delete
[1270] Fix | Delete
var boundActionCreators = {};
[1271] Fix | Delete
[1272] Fix | Delete
for (var key in actionCreators) {
[1273] Fix | Delete
var actionCreator = actionCreators[key];
[1274] Fix | Delete
[1275] Fix | Delete
if (typeof actionCreator === 'function') {
[1276] Fix | Delete
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
[1277] Fix | Delete
}
[1278] Fix | Delete
}
[1279] Fix | Delete
[1280] Fix | Delete
return boundActionCreators;
[1281] Fix | Delete
}
[1282] Fix | Delete
[1283] Fix | Delete
/**
[1284] Fix | Delete
* Composes single-argument functions from right to left. The rightmost
[1285] Fix | Delete
* function can take multiple arguments as it provides the signature for
[1286] Fix | Delete
* the resulting composite function.
[1287] Fix | Delete
*
[1288] Fix | Delete
* @param {...Function} funcs The functions to compose.
[1289] Fix | Delete
* @returns {Function} A function obtained by composing the argument functions
[1290] Fix | Delete
* from right to left. For example, compose(f, g, h) is identical to doing
[1291] Fix | Delete
* (...args) => f(g(h(...args))).
[1292] Fix | Delete
*/
[1293] Fix | Delete
function compose() {
[1294] Fix | Delete
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
[1295] Fix | Delete
funcs[_key] = arguments[_key];
[1296] Fix | Delete
}
[1297] Fix | Delete
[1298] Fix | Delete
if (funcs.length === 0) {
[1299] Fix | Delete
return function (arg) {
[1300] Fix | Delete
return arg;
[1301] Fix | Delete
};
[1302] Fix | Delete
}
[1303] Fix | Delete
[1304] Fix | Delete
if (funcs.length === 1) {
[1305] Fix | Delete
return funcs[0];
[1306] Fix | Delete
}
[1307] Fix | Delete
[1308] Fix | Delete
return funcs.reduce(function (a, b) {
[1309] Fix | Delete
return function () {
[1310] Fix | Delete
return a(b.apply(void 0, arguments));
[1311] Fix | Delete
};
[1312] Fix | Delete
});
[1313] Fix | Delete
}
[1314] Fix | Delete
[1315] Fix | Delete
/**
[1316] Fix | Delete
* Creates a store enhancer that applies middleware to the dispatch method
[1317] Fix | Delete
* of the Redux store. This is handy for a variety of tasks, such as expressing
[1318] Fix | Delete
* asynchronous actions in a concise manner, or logging every action payload.
[1319] Fix | Delete
*
[1320] Fix | Delete
* See `redux-thunk` package as an example of the Redux middleware.
[1321] Fix | Delete
*
[1322] Fix | Delete
* Because middleware is potentially asynchronous, this should be the first
[1323] Fix | Delete
* store enhancer in the composition chain.
[1324] Fix | Delete
*
[1325] Fix | Delete
* Note that each middleware will be given the `dispatch` and `getState` functions
[1326] Fix | Delete
* as named arguments.
[1327] Fix | Delete
*
[1328] Fix | Delete
* @param {...Function} middlewares The middleware chain to be applied.
[1329] Fix | Delete
* @returns {Function} A store enhancer applying the middleware.
[1330] Fix | Delete
*/
[1331] Fix | Delete
[1332] Fix | Delete
function applyMiddleware() {
[1333] Fix | Delete
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
[1334] Fix | Delete
middlewares[_key] = arguments[_key];
[1335] Fix | Delete
}
[1336] Fix | Delete
[1337] Fix | Delete
return function (createStore) {
[1338] Fix | Delete
return function () {
[1339] Fix | Delete
var store = createStore.apply(void 0, arguments);
[1340] Fix | Delete
[1341] Fix | Delete
var _dispatch = function dispatch() {
[1342] Fix | Delete
throw new Error( true ? formatProdErrorMessage(15) : 0);
[1343] Fix | Delete
};
[1344] Fix | Delete
[1345] Fix | Delete
var middlewareAPI = {
[1346] Fix | Delete
getState: store.getState,
[1347] Fix | Delete
dispatch: function dispatch() {
[1348] Fix | Delete
return _dispatch.apply(void 0, arguments);
[1349] Fix | Delete
}
[1350] Fix | Delete
};
[1351] Fix | Delete
var chain = middlewares.map(function (middleware) {
[1352] Fix | Delete
return middleware(middlewareAPI);
[1353] Fix | Delete
});
[1354] Fix | Delete
_dispatch = compose.apply(void 0, chain)(store.dispatch);
[1355] Fix | Delete
return _objectSpread2(_objectSpread2({}, store), {}, {
[1356] Fix | Delete
dispatch: _dispatch
[1357] Fix | Delete
});
[1358] Fix | Delete
};
[1359] Fix | Delete
};
[1360] Fix | Delete
}
[1361] Fix | Delete
[1362] Fix | Delete
[1363] Fix | Delete
[1364] Fix | Delete
// EXTERNAL MODULE: ./node_modules/equivalent-key-map/equivalent-key-map.js
[1365] Fix | Delete
var equivalent_key_map = __webpack_require__(3249);
[1366] Fix | Delete
var equivalent_key_map_default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map);
[1367] Fix | Delete
;// CONCATENATED MODULE: external ["wp","reduxRoutine"]
[1368] Fix | Delete
const external_wp_reduxRoutine_namespaceObject = window["wp"]["reduxRoutine"];
[1369] Fix | Delete
var external_wp_reduxRoutine_default = /*#__PURE__*/__webpack_require__.n(external_wp_reduxRoutine_namespaceObject);
[1370] Fix | Delete
;// CONCATENATED MODULE: external ["wp","compose"]
[1371] Fix | Delete
const external_wp_compose_namespaceObject = window["wp"]["compose"];
[1372] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/redux-store/combine-reducers.js
[1373] Fix | Delete
function combine_reducers_combineReducers(reducers) {
[1374] Fix | Delete
const keys = Object.keys(reducers);
[1375] Fix | Delete
return function combinedReducer(state = {}, action) {
[1376] Fix | Delete
const nextState = {};
[1377] Fix | Delete
let hasChanged = false;
[1378] Fix | Delete
for (const key of keys) {
[1379] Fix | Delete
const reducer = reducers[key];
[1380] Fix | Delete
const prevStateForKey = state[key];
[1381] Fix | Delete
const nextStateForKey = reducer(prevStateForKey, action);
[1382] Fix | Delete
nextState[key] = nextStateForKey;
[1383] Fix | Delete
hasChanged = hasChanged || nextStateForKey !== prevStateForKey;
[1384] Fix | Delete
}
[1385] Fix | Delete
return hasChanged ? nextState : state;
[1386] Fix | Delete
};
[1387] Fix | Delete
}
[1388] Fix | Delete
[1389] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/factory.js
[1390] Fix | Delete
/**
[1391] Fix | Delete
* Creates a selector function that takes additional curried argument with the
[1392] Fix | Delete
* registry `select` function. While a regular selector has signature
[1393] Fix | Delete
* ```js
[1394] Fix | Delete
* ( state, ...selectorArgs ) => ( result )
[1395] Fix | Delete
* ```
[1396] Fix | Delete
* that allows to select data from the store's `state`, a registry selector
[1397] Fix | Delete
* has signature:
[1398] Fix | Delete
* ```js
[1399] Fix | Delete
* ( select ) => ( state, ...selectorArgs ) => ( result )
[1400] Fix | Delete
* ```
[1401] Fix | Delete
* that supports also selecting from other registered stores.
[1402] Fix | Delete
*
[1403] Fix | Delete
* @example
[1404] Fix | Delete
* ```js
[1405] Fix | Delete
* import { store as coreStore } from '@wordpress/core-data';
[1406] Fix | Delete
* import { store as editorStore } from '@wordpress/editor';
[1407] Fix | Delete
*
[1408] Fix | Delete
* const getCurrentPostId = createRegistrySelector( ( select ) => ( state ) => {
[1409] Fix | Delete
* return select( editorStore ).getCurrentPostId();
[1410] Fix | Delete
* } );
[1411] Fix | Delete
*
[1412] Fix | Delete
* const getPostEdits = createRegistrySelector( ( select ) => ( state ) => {
[1413] Fix | Delete
* // calling another registry selector just like any other function
[1414] Fix | Delete
* const postType = getCurrentPostType( state );
[1415] Fix | Delete
* const postId = getCurrentPostId( state );
[1416] Fix | Delete
* return select( coreStore ).getEntityRecordEdits( 'postType', postType, postId );
[1417] Fix | Delete
* } );
[1418] Fix | Delete
* ```
[1419] Fix | Delete
*
[1420] Fix | Delete
* Note how the `getCurrentPostId` selector can be called just like any other function,
[1421] Fix | Delete
* (it works even inside a regular non-registry selector) and we don't need to pass the
[1422] Fix | Delete
* registry as argument. The registry binding happens automatically when registering the selector
[1423] Fix | Delete
* with a store.
[1424] Fix | Delete
*
[1425] Fix | Delete
* @param {Function} registrySelector Function receiving a registry `select`
[1426] Fix | Delete
* function and returning a state selector.
[1427] Fix | Delete
*
[1428] Fix | Delete
* @return {Function} Registry selector that can be registered with a store.
[1429] Fix | Delete
*/
[1430] Fix | Delete
function createRegistrySelector(registrySelector) {
[1431] Fix | Delete
const selectorsByRegistry = new WeakMap();
[1432] Fix | Delete
// Create a selector function that is bound to the registry referenced by `selector.registry`
[1433] Fix | Delete
// and that has the same API as a regular selector. Binding it in such a way makes it
[1434] Fix | Delete
// possible to call the selector directly from another selector.
[1435] Fix | Delete
const wrappedSelector = (...args) => {
[1436] Fix | Delete
let selector = selectorsByRegistry.get(wrappedSelector.registry);
[1437] Fix | Delete
// We want to make sure the cache persists even when new registry
[1438] Fix | Delete
// instances are created. For example patterns create their own editors
[1439] Fix | Delete
// with their own core/block-editor stores, so we should keep track of
[1440] Fix | Delete
// the cache for each registry instance.
[1441] Fix | Delete
if (!selector) {
[1442] Fix | Delete
selector = registrySelector(wrappedSelector.registry.select);
[1443] Fix | Delete
selectorsByRegistry.set(wrappedSelector.registry, selector);
[1444] Fix | Delete
}
[1445] Fix | Delete
return selector(...args);
[1446] Fix | Delete
};
[1447] Fix | Delete
[1448] Fix | Delete
/**
[1449] Fix | Delete
* Flag indicating that the selector is a registry selector that needs the correct registry
[1450] Fix | Delete
* reference to be assigned to `selector.registry` to make it work correctly.
[1451] Fix | Delete
* be mapped as a registry selector.
[1452] Fix | Delete
*
[1453] Fix | Delete
* @type {boolean}
[1454] Fix | Delete
*/
[1455] Fix | Delete
wrappedSelector.isRegistrySelector = true;
[1456] Fix | Delete
return wrappedSelector;
[1457] Fix | Delete
}
[1458] Fix | Delete
[1459] Fix | Delete
/**
[1460] Fix | Delete
* Creates a control function that takes additional curried argument with the `registry` object.
[1461] Fix | Delete
* While a regular control has signature
[1462] Fix | Delete
* ```js
[1463] Fix | Delete
* ( action ) => ( iteratorOrPromise )
[1464] Fix | Delete
* ```
[1465] Fix | Delete
* where the control works with the `action` that it's bound to, a registry control has signature:
[1466] Fix | Delete
* ```js
[1467] Fix | Delete
* ( registry ) => ( action ) => ( iteratorOrPromise )
[1468] Fix | Delete
* ```
[1469] Fix | Delete
* A registry control is typically used to select data or dispatch an action to a registered
[1470] Fix | Delete
* store.
[1471] Fix | Delete
*
[1472] Fix | Delete
* When registering a control created with `createRegistryControl` with a store, the store
[1473] Fix | Delete
* knows which calling convention to use when executing the control.
[1474] Fix | Delete
*
[1475] Fix | Delete
* @param {Function} registryControl Function receiving a registry object and returning a control.
[1476] Fix | Delete
*
[1477] Fix | Delete
* @return {Function} Registry control that can be registered with a store.
[1478] Fix | Delete
*/
[1479] Fix | Delete
function createRegistryControl(registryControl) {
[1480] Fix | Delete
registryControl.isRegistryControl = true;
[1481] Fix | Delete
return registryControl;
[1482] Fix | Delete
}
[1483] Fix | Delete
[1484] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/controls.js
[1485] Fix | Delete
/**
[1486] Fix | Delete
* Internal dependencies
[1487] Fix | Delete
*/
[1488] Fix | Delete
[1489] Fix | Delete
[1490] Fix | Delete
/** @typedef {import('./types').StoreDescriptor} StoreDescriptor */
[1491] Fix | Delete
[1492] Fix | Delete
const SELECT = '@@data/SELECT';
[1493] Fix | Delete
const RESOLVE_SELECT = '@@data/RESOLVE_SELECT';
[1494] Fix | Delete
const DISPATCH = '@@data/DISPATCH';
[1495] Fix | Delete
function isObject(object) {
[1496] Fix | Delete
return object !== null && typeof object === 'object';
[1497] Fix | Delete
}
[1498] Fix | Delete
[1499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function