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
...resolver,
[3000] Fix | Delete
// Copy the enumerable properties of the resolver function.
[3001] Fix | Delete
fulfill: resolver // Add the fulfill method.
[3002] Fix | Delete
};
[3003] Fix | Delete
});
[3004] Fix | Delete
}
[3005] Fix | Delete
[3006] Fix | Delete
/**
[3007] Fix | Delete
* Returns a selector with a matched resolver.
[3008] Fix | Delete
* Resolvers are side effects invoked once per argument set of a given selector call,
[3009] Fix | Delete
* used in ensuring that the data needs for the selector are satisfied.
[3010] Fix | Delete
*
[3011] Fix | Delete
* @param {Object} selector The selector function to be bound.
[3012] Fix | Delete
* @param {string} selectorName The selector name.
[3013] Fix | Delete
* @param {Object} resolver Resolver to call.
[3014] Fix | Delete
* @param {Object} store The redux store to which the resolvers should be mapped.
[3015] Fix | Delete
* @param {Object} resolversCache Resolvers Cache.
[3016] Fix | Delete
*/
[3017] Fix | Delete
function mapSelectorWithResolver(selector, selectorName, resolver, store, resolversCache) {
[3018] Fix | Delete
function fulfillSelector(args) {
[3019] Fix | Delete
const state = store.getState();
[3020] Fix | Delete
if (resolversCache.isRunning(selectorName, args) || typeof resolver.isFulfilled === 'function' && resolver.isFulfilled(state, ...args)) {
[3021] Fix | Delete
return;
[3022] Fix | Delete
}
[3023] Fix | Delete
const {
[3024] Fix | Delete
metadata
[3025] Fix | Delete
} = store.__unstableOriginalGetState();
[3026] Fix | Delete
if (hasStartedResolution(metadata, selectorName, args)) {
[3027] Fix | Delete
return;
[3028] Fix | Delete
}
[3029] Fix | Delete
resolversCache.markAsRunning(selectorName, args);
[3030] Fix | Delete
setTimeout(async () => {
[3031] Fix | Delete
resolversCache.clear(selectorName, args);
[3032] Fix | Delete
store.dispatch(startResolution(selectorName, args));
[3033] Fix | Delete
try {
[3034] Fix | Delete
const action = resolver.fulfill(...args);
[3035] Fix | Delete
if (action) {
[3036] Fix | Delete
await store.dispatch(action);
[3037] Fix | Delete
}
[3038] Fix | Delete
store.dispatch(finishResolution(selectorName, args));
[3039] Fix | Delete
} catch (error) {
[3040] Fix | Delete
store.dispatch(failResolution(selectorName, args, error));
[3041] Fix | Delete
}
[3042] Fix | Delete
}, 0);
[3043] Fix | Delete
}
[3044] Fix | Delete
const selectorResolver = (...args) => {
[3045] Fix | Delete
args = normalize(selector, args);
[3046] Fix | Delete
fulfillSelector(args);
[3047] Fix | Delete
return selector(...args);
[3048] Fix | Delete
};
[3049] Fix | Delete
selectorResolver.hasResolver = true;
[3050] Fix | Delete
return selectorResolver;
[3051] Fix | Delete
}
[3052] Fix | Delete
[3053] Fix | Delete
/**
[3054] Fix | Delete
* Applies selector's normalization function to the given arguments
[3055] Fix | Delete
* if it exists.
[3056] Fix | Delete
*
[3057] Fix | Delete
* @param {Object} selector The selector potentially with a normalization method property.
[3058] Fix | Delete
* @param {Array} args selector arguments to normalize.
[3059] Fix | Delete
* @return {Array} Potentially normalized arguments.
[3060] Fix | Delete
*/
[3061] Fix | Delete
function normalize(selector, args) {
[3062] Fix | Delete
if (selector.__unstableNormalizeArgs && typeof selector.__unstableNormalizeArgs === 'function' && args?.length) {
[3063] Fix | Delete
return selector.__unstableNormalizeArgs(args);
[3064] Fix | Delete
}
[3065] Fix | Delete
return args;
[3066] Fix | Delete
}
[3067] Fix | Delete
[3068] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/store/index.js
[3069] Fix | Delete
const coreDataStore = {
[3070] Fix | Delete
name: 'core/data',
[3071] Fix | Delete
instantiate(registry) {
[3072] Fix | Delete
const getCoreDataSelector = selectorName => (key, ...args) => {
[3073] Fix | Delete
return registry.select(key)[selectorName](...args);
[3074] Fix | Delete
};
[3075] Fix | Delete
const getCoreDataAction = actionName => (key, ...args) => {
[3076] Fix | Delete
return registry.dispatch(key)[actionName](...args);
[3077] Fix | Delete
};
[3078] Fix | Delete
return {
[3079] Fix | Delete
getSelectors() {
[3080] Fix | Delete
return Object.fromEntries(['getIsResolving', 'hasStartedResolution', 'hasFinishedResolution', 'isResolving', 'getCachedResolvers'].map(selectorName => [selectorName, getCoreDataSelector(selectorName)]));
[3081] Fix | Delete
},
[3082] Fix | Delete
getActions() {
[3083] Fix | Delete
return Object.fromEntries(['startResolution', 'finishResolution', 'invalidateResolution', 'invalidateResolutionForStore', 'invalidateResolutionForStoreSelector'].map(actionName => [actionName, getCoreDataAction(actionName)]));
[3084] Fix | Delete
},
[3085] Fix | Delete
subscribe() {
[3086] Fix | Delete
// There's no reasons to trigger any listener when we subscribe to this store
[3087] Fix | Delete
// because there's no state stored in this store that need to retrigger selectors
[3088] Fix | Delete
// if a change happens, the corresponding store where the tracking stated live
[3089] Fix | Delete
// would have already triggered a "subscribe" call.
[3090] Fix | Delete
return () => () => {};
[3091] Fix | Delete
}
[3092] Fix | Delete
};
[3093] Fix | Delete
}
[3094] Fix | Delete
};
[3095] Fix | Delete
/* harmony default export */ const store = (coreDataStore);
[3096] Fix | Delete
[3097] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/utils/emitter.js
[3098] Fix | Delete
/**
[3099] Fix | Delete
* Create an event emitter.
[3100] Fix | Delete
*
[3101] Fix | Delete
* @return {import("../types").DataEmitter} Emitter.
[3102] Fix | Delete
*/
[3103] Fix | Delete
function createEmitter() {
[3104] Fix | Delete
let isPaused = false;
[3105] Fix | Delete
let isPending = false;
[3106] Fix | Delete
const listeners = new Set();
[3107] Fix | Delete
const notifyListeners = () =>
[3108] Fix | Delete
// We use Array.from to clone the listeners Set
[3109] Fix | Delete
// This ensures that we don't run a listener
[3110] Fix | Delete
// that was added as a response to another listener.
[3111] Fix | Delete
Array.from(listeners).forEach(listener => listener());
[3112] Fix | Delete
return {
[3113] Fix | Delete
get isPaused() {
[3114] Fix | Delete
return isPaused;
[3115] Fix | Delete
},
[3116] Fix | Delete
subscribe(listener) {
[3117] Fix | Delete
listeners.add(listener);
[3118] Fix | Delete
return () => listeners.delete(listener);
[3119] Fix | Delete
},
[3120] Fix | Delete
pause() {
[3121] Fix | Delete
isPaused = true;
[3122] Fix | Delete
},
[3123] Fix | Delete
resume() {
[3124] Fix | Delete
isPaused = false;
[3125] Fix | Delete
if (isPending) {
[3126] Fix | Delete
isPending = false;
[3127] Fix | Delete
notifyListeners();
[3128] Fix | Delete
}
[3129] Fix | Delete
},
[3130] Fix | Delete
emit() {
[3131] Fix | Delete
if (isPaused) {
[3132] Fix | Delete
isPending = true;
[3133] Fix | Delete
return;
[3134] Fix | Delete
}
[3135] Fix | Delete
notifyListeners();
[3136] Fix | Delete
}
[3137] Fix | Delete
};
[3138] Fix | Delete
}
[3139] Fix | Delete
[3140] Fix | Delete
;// CONCATENATED MODULE: ./node_modules/@wordpress/data/build-module/registry.js
[3141] Fix | Delete
/**
[3142] Fix | Delete
* WordPress dependencies
[3143] Fix | Delete
*/
[3144] Fix | Delete
[3145] Fix | Delete
[3146] Fix | Delete
/**
[3147] Fix | Delete
* Internal dependencies
[3148] Fix | Delete
*/
[3149] Fix | Delete
[3150] Fix | Delete
[3151] Fix | Delete
[3152] Fix | Delete
[3153] Fix | Delete
[3154] Fix | Delete
/** @typedef {import('./types').StoreDescriptor} StoreDescriptor */
[3155] Fix | Delete
[3156] Fix | Delete
/**
[3157] Fix | Delete
* @typedef {Object} WPDataRegistry An isolated orchestrator of store registrations.
[3158] Fix | Delete
*
[3159] Fix | Delete
* @property {Function} registerGenericStore Given a namespace key and settings
[3160] Fix | Delete
* object, registers a new generic
[3161] Fix | Delete
* store.
[3162] Fix | Delete
* @property {Function} registerStore Given a namespace key and settings
[3163] Fix | Delete
* object, registers a new namespace
[3164] Fix | Delete
* store.
[3165] Fix | Delete
* @property {Function} subscribe Given a function callback, invokes
[3166] Fix | Delete
* the callback on any change to state
[3167] Fix | Delete
* within any registered store.
[3168] Fix | Delete
* @property {Function} select Given a namespace key, returns an
[3169] Fix | Delete
* object of the store's registered
[3170] Fix | Delete
* selectors.
[3171] Fix | Delete
* @property {Function} dispatch Given a namespace key, returns an
[3172] Fix | Delete
* object of the store's registered
[3173] Fix | Delete
* action dispatchers.
[3174] Fix | Delete
*/
[3175] Fix | Delete
[3176] Fix | Delete
/**
[3177] Fix | Delete
* @typedef {Object} WPDataPlugin An object of registry function overrides.
[3178] Fix | Delete
*
[3179] Fix | Delete
* @property {Function} registerStore registers store.
[3180] Fix | Delete
*/
[3181] Fix | Delete
[3182] Fix | Delete
function getStoreName(storeNameOrDescriptor) {
[3183] Fix | Delete
return typeof storeNameOrDescriptor === 'string' ? storeNameOrDescriptor : storeNameOrDescriptor.name;
[3184] Fix | Delete
}
[3185] Fix | Delete
/**
[3186] Fix | Delete
* Creates a new store registry, given an optional object of initial store
[3187] Fix | Delete
* configurations.
[3188] Fix | Delete
*
[3189] Fix | Delete
* @param {Object} storeConfigs Initial store configurations.
[3190] Fix | Delete
* @param {Object?} parent Parent registry.
[3191] Fix | Delete
*
[3192] Fix | Delete
* @return {WPDataRegistry} Data registry.
[3193] Fix | Delete
*/
[3194] Fix | Delete
function createRegistry(storeConfigs = {}, parent = null) {
[3195] Fix | Delete
const stores = {};
[3196] Fix | Delete
const emitter = createEmitter();
[3197] Fix | Delete
let listeningStores = null;
[3198] Fix | Delete
[3199] Fix | Delete
/**
[3200] Fix | Delete
* Global listener called for each store's update.
[3201] Fix | Delete
*/
[3202] Fix | Delete
function globalListener() {
[3203] Fix | Delete
emitter.emit();
[3204] Fix | Delete
}
[3205] Fix | Delete
[3206] Fix | Delete
/**
[3207] Fix | Delete
* Subscribe to changes to any data, either in all stores in registry, or
[3208] Fix | Delete
* in one specific store.
[3209] Fix | Delete
*
[3210] Fix | Delete
* @param {Function} listener Listener function.
[3211] Fix | Delete
* @param {string|StoreDescriptor?} storeNameOrDescriptor Optional store name.
[3212] Fix | Delete
*
[3213] Fix | Delete
* @return {Function} Unsubscribe function.
[3214] Fix | Delete
*/
[3215] Fix | Delete
const subscribe = (listener, storeNameOrDescriptor) => {
[3216] Fix | Delete
// subscribe to all stores
[3217] Fix | Delete
if (!storeNameOrDescriptor) {
[3218] Fix | Delete
return emitter.subscribe(listener);
[3219] Fix | Delete
}
[3220] Fix | Delete
[3221] Fix | Delete
// subscribe to one store
[3222] Fix | Delete
const storeName = getStoreName(storeNameOrDescriptor);
[3223] Fix | Delete
const store = stores[storeName];
[3224] Fix | Delete
if (store) {
[3225] Fix | Delete
return store.subscribe(listener);
[3226] Fix | Delete
}
[3227] Fix | Delete
[3228] Fix | Delete
// Trying to access a store that hasn't been registered,
[3229] Fix | Delete
// this is a pattern rarely used but seen in some places.
[3230] Fix | Delete
// We fallback to global `subscribe` here for backward-compatibility for now.
[3231] Fix | Delete
// See https://github.com/WordPress/gutenberg/pull/27466 for more info.
[3232] Fix | Delete
if (!parent) {
[3233] Fix | Delete
return emitter.subscribe(listener);
[3234] Fix | Delete
}
[3235] Fix | Delete
return parent.subscribe(listener, storeNameOrDescriptor);
[3236] Fix | Delete
};
[3237] Fix | Delete
[3238] Fix | Delete
/**
[3239] Fix | Delete
* Calls a selector given the current state and extra arguments.
[3240] Fix | Delete
*
[3241] Fix | Delete
* @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
[3242] Fix | Delete
* or the store descriptor.
[3243] Fix | Delete
*
[3244] Fix | Delete
* @return {*} The selector's returned value.
[3245] Fix | Delete
*/
[3246] Fix | Delete
function select(storeNameOrDescriptor) {
[3247] Fix | Delete
const storeName = getStoreName(storeNameOrDescriptor);
[3248] Fix | Delete
listeningStores?.add(storeName);
[3249] Fix | Delete
const store = stores[storeName];
[3250] Fix | Delete
if (store) {
[3251] Fix | Delete
return store.getSelectors();
[3252] Fix | Delete
}
[3253] Fix | Delete
return parent?.select(storeName);
[3254] Fix | Delete
}
[3255] Fix | Delete
function __unstableMarkListeningStores(callback, ref) {
[3256] Fix | Delete
listeningStores = new Set();
[3257] Fix | Delete
try {
[3258] Fix | Delete
return callback.call(this);
[3259] Fix | Delete
} finally {
[3260] Fix | Delete
ref.current = Array.from(listeningStores);
[3261] Fix | Delete
listeningStores = null;
[3262] Fix | Delete
}
[3263] Fix | Delete
}
[3264] Fix | Delete
[3265] Fix | Delete
/**
[3266] Fix | Delete
* Given a store descriptor, returns an object containing the store's selectors pre-bound to
[3267] Fix | Delete
* state so that you only need to supply additional arguments, and modified so that they return
[3268] Fix | Delete
* promises that resolve to their eventual values, after any resolvers have ran.
[3269] Fix | Delete
*
[3270] Fix | Delete
* @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling
[3271] Fix | Delete
* convention of passing the store name is
[3272] Fix | Delete
* also supported.
[3273] Fix | Delete
*
[3274] Fix | Delete
* @return {Object} Each key of the object matches the name of a selector.
[3275] Fix | Delete
*/
[3276] Fix | Delete
function resolveSelect(storeNameOrDescriptor) {
[3277] Fix | Delete
const storeName = getStoreName(storeNameOrDescriptor);
[3278] Fix | Delete
listeningStores?.add(storeName);
[3279] Fix | Delete
const store = stores[storeName];
[3280] Fix | Delete
if (store) {
[3281] Fix | Delete
return store.getResolveSelectors();
[3282] Fix | Delete
}
[3283] Fix | Delete
return parent && parent.resolveSelect(storeName);
[3284] Fix | Delete
}
[3285] Fix | Delete
[3286] Fix | Delete
/**
[3287] Fix | Delete
* Given a store descriptor, returns an object containing the store's selectors pre-bound to
[3288] Fix | Delete
* state so that you only need to supply additional arguments, and modified so that they throw
[3289] Fix | Delete
* promises in case the selector is not resolved yet.
[3290] Fix | Delete
*
[3291] Fix | Delete
* @param {StoreDescriptor|string} storeNameOrDescriptor The store descriptor. The legacy calling
[3292] Fix | Delete
* convention of passing the store name is
[3293] Fix | Delete
* also supported.
[3294] Fix | Delete
*
[3295] Fix | Delete
* @return {Object} Object containing the store's suspense-wrapped selectors.
[3296] Fix | Delete
*/
[3297] Fix | Delete
function suspendSelect(storeNameOrDescriptor) {
[3298] Fix | Delete
const storeName = getStoreName(storeNameOrDescriptor);
[3299] Fix | Delete
listeningStores?.add(storeName);
[3300] Fix | Delete
const store = stores[storeName];
[3301] Fix | Delete
if (store) {
[3302] Fix | Delete
return store.getSuspendSelectors();
[3303] Fix | Delete
}
[3304] Fix | Delete
return parent && parent.suspendSelect(storeName);
[3305] Fix | Delete
}
[3306] Fix | Delete
[3307] Fix | Delete
/**
[3308] Fix | Delete
* Returns the available actions for a part of the state.
[3309] Fix | Delete
*
[3310] Fix | Delete
* @param {string|StoreDescriptor} storeNameOrDescriptor Unique namespace identifier for the store
[3311] Fix | Delete
* or the store descriptor.
[3312] Fix | Delete
*
[3313] Fix | Delete
* @return {*} The action's returned value.
[3314] Fix | Delete
*/
[3315] Fix | Delete
function dispatch(storeNameOrDescriptor) {
[3316] Fix | Delete
const storeName = getStoreName(storeNameOrDescriptor);
[3317] Fix | Delete
const store = stores[storeName];
[3318] Fix | Delete
if (store) {
[3319] Fix | Delete
return store.getActions();
[3320] Fix | Delete
}
[3321] Fix | Delete
return parent && parent.dispatch(storeName);
[3322] Fix | Delete
}
[3323] Fix | Delete
[3324] Fix | Delete
//
[3325] Fix | Delete
// Deprecated
[3326] Fix | Delete
// TODO: Remove this after `use()` is removed.
[3327] Fix | Delete
function withPlugins(attributes) {
[3328] Fix | Delete
return Object.fromEntries(Object.entries(attributes).map(([key, attribute]) => {
[3329] Fix | Delete
if (typeof attribute !== 'function') {
[3330] Fix | Delete
return [key, attribute];
[3331] Fix | Delete
}
[3332] Fix | Delete
return [key, function () {
[3333] Fix | Delete
return registry[key].apply(null, arguments);
[3334] Fix | Delete
}];
[3335] Fix | Delete
}));
[3336] Fix | Delete
}
[3337] Fix | Delete
[3338] Fix | Delete
/**
[3339] Fix | Delete
* Registers a store instance.
[3340] Fix | Delete
*
[3341] Fix | Delete
* @param {string} name Store registry name.
[3342] Fix | Delete
* @param {Function} createStore Function that creates a store object (getSelectors, getActions, subscribe).
[3343] Fix | Delete
*/
[3344] Fix | Delete
function registerStoreInstance(name, createStore) {
[3345] Fix | Delete
if (stores[name]) {
[3346] Fix | Delete
// eslint-disable-next-line no-console
[3347] Fix | Delete
console.error('Store "' + name + '" is already registered.');
[3348] Fix | Delete
return stores[name];
[3349] Fix | Delete
}
[3350] Fix | Delete
const store = createStore();
[3351] Fix | Delete
if (typeof store.getSelectors !== 'function') {
[3352] Fix | Delete
throw new TypeError('store.getSelectors must be a function');
[3353] Fix | Delete
}
[3354] Fix | Delete
if (typeof store.getActions !== 'function') {
[3355] Fix | Delete
throw new TypeError('store.getActions must be a function');
[3356] Fix | Delete
}
[3357] Fix | Delete
if (typeof store.subscribe !== 'function') {
[3358] Fix | Delete
throw new TypeError('store.subscribe must be a function');
[3359] Fix | Delete
}
[3360] Fix | Delete
// The emitter is used to keep track of active listeners when the registry
[3361] Fix | Delete
// get paused, that way, when resumed we should be able to call all these
[3362] Fix | Delete
// pending listeners.
[3363] Fix | Delete
store.emitter = createEmitter();
[3364] Fix | Delete
const currentSubscribe = store.subscribe;
[3365] Fix | Delete
store.subscribe = listener => {
[3366] Fix | Delete
const unsubscribeFromEmitter = store.emitter.subscribe(listener);
[3367] Fix | Delete
const unsubscribeFromStore = currentSubscribe(() => {
[3368] Fix | Delete
if (store.emitter.isPaused) {
[3369] Fix | Delete
store.emitter.emit();
[3370] Fix | Delete
return;
[3371] Fix | Delete
}
[3372] Fix | Delete
listener();
[3373] Fix | Delete
});
[3374] Fix | Delete
return () => {
[3375] Fix | Delete
unsubscribeFromStore?.();
[3376] Fix | Delete
unsubscribeFromEmitter?.();
[3377] Fix | Delete
};
[3378] Fix | Delete
};
[3379] Fix | Delete
stores[name] = store;
[3380] Fix | Delete
store.subscribe(globalListener);
[3381] Fix | Delete
[3382] Fix | Delete
// Copy private actions and selectors from the parent store.
[3383] Fix | Delete
if (parent) {
[3384] Fix | Delete
try {
[3385] Fix | Delete
unlock(store.store).registerPrivateActions(unlock(parent).privateActionsOf(name));
[3386] Fix | Delete
unlock(store.store).registerPrivateSelectors(unlock(parent).privateSelectorsOf(name));
[3387] Fix | Delete
} catch (e) {
[3388] Fix | Delete
// unlock() throws if store.store was not locked.
[3389] Fix | Delete
// The error indicates there's nothing to do here so let's
[3390] Fix | Delete
// ignore it.
[3391] Fix | Delete
}
[3392] Fix | Delete
}
[3393] Fix | Delete
return store;
[3394] Fix | Delete
}
[3395] Fix | Delete
[3396] Fix | Delete
/**
[3397] Fix | Delete
* Registers a new store given a store descriptor.
[3398] Fix | Delete
*
[3399] Fix | Delete
* @param {StoreDescriptor} store Store descriptor.
[3400] Fix | Delete
*/
[3401] Fix | Delete
function register(store) {
[3402] Fix | Delete
registerStoreInstance(store.name, () => store.instantiate(registry));
[3403] Fix | Delete
}
[3404] Fix | Delete
function registerGenericStore(name, store) {
[3405] Fix | Delete
external_wp_deprecated_default()('wp.data.registerGenericStore', {
[3406] Fix | Delete
since: '5.9',
[3407] Fix | Delete
alternative: 'wp.data.register( storeDescriptor )'
[3408] Fix | Delete
});
[3409] Fix | Delete
registerStoreInstance(name, () => store);
[3410] Fix | Delete
}
[3411] Fix | Delete
[3412] Fix | Delete
/**
[3413] Fix | Delete
* Registers a standard `@wordpress/data` store.
[3414] Fix | Delete
*
[3415] Fix | Delete
* @param {string} storeName Unique namespace identifier.
[3416] Fix | Delete
* @param {Object} options Store description (reducer, actions, selectors, resolvers).
[3417] Fix | Delete
*
[3418] Fix | Delete
* @return {Object} Registered store object.
[3419] Fix | Delete
*/
[3420] Fix | Delete
function registerStore(storeName, options) {
[3421] Fix | Delete
if (!options.reducer) {
[3422] Fix | Delete
throw new TypeError('Must specify store reducer');
[3423] Fix | Delete
}
[3424] Fix | Delete
const store = registerStoreInstance(storeName, () => createReduxStore(storeName, options).instantiate(registry));
[3425] Fix | Delete
return store.store;
[3426] Fix | Delete
}
[3427] Fix | Delete
function batch(callback) {
[3428] Fix | Delete
// If we're already batching, just call the callback.
[3429] Fix | Delete
if (emitter.isPaused) {
[3430] Fix | Delete
callback();
[3431] Fix | Delete
return;
[3432] Fix | Delete
}
[3433] Fix | Delete
emitter.pause();
[3434] Fix | Delete
Object.values(stores).forEach(store => store.emitter.pause());
[3435] Fix | Delete
try {
[3436] Fix | Delete
callback();
[3437] Fix | Delete
} finally {
[3438] Fix | Delete
emitter.resume();
[3439] Fix | Delete
Object.values(stores).forEach(store => store.emitter.resume());
[3440] Fix | Delete
}
[3441] Fix | Delete
}
[3442] Fix | Delete
let registry = {
[3443] Fix | Delete
batch,
[3444] Fix | Delete
stores,
[3445] Fix | Delete
namespaces: stores,
[3446] Fix | Delete
// TODO: Deprecate/remove this.
[3447] Fix | Delete
subscribe,
[3448] Fix | Delete
select,
[3449] Fix | Delete
resolveSelect,
[3450] Fix | Delete
suspendSelect,
[3451] Fix | Delete
dispatch,
[3452] Fix | Delete
use,
[3453] Fix | Delete
register,
[3454] Fix | Delete
registerGenericStore,
[3455] Fix | Delete
registerStore,
[3456] Fix | Delete
__unstableMarkListeningStores
[3457] Fix | Delete
};
[3458] Fix | Delete
[3459] Fix | Delete
//
[3460] Fix | Delete
// TODO:
[3461] Fix | Delete
// This function will be deprecated as soon as it is no longer internally referenced.
[3462] Fix | Delete
function use(plugin, options) {
[3463] Fix | Delete
if (!plugin) {
[3464] Fix | Delete
return;
[3465] Fix | Delete
}
[3466] Fix | Delete
registry = {
[3467] Fix | Delete
...registry,
[3468] Fix | Delete
...plugin(registry, options)
[3469] Fix | Delete
};
[3470] Fix | Delete
return registry;
[3471] Fix | Delete
}
[3472] Fix | Delete
registry.register(store);
[3473] Fix | Delete
for (const [name, config] of Object.entries(storeConfigs)) {
[3474] Fix | Delete
registry.register(createReduxStore(name, config));
[3475] Fix | Delete
}
[3476] Fix | Delete
if (parent) {
[3477] Fix | Delete
parent.subscribe(globalListener);
[3478] Fix | Delete
}
[3479] Fix | Delete
const registryWithPlugins = withPlugins(registry);
[3480] Fix | Delete
lock(registryWithPlugins, {
[3481] Fix | Delete
privateActionsOf: name => {
[3482] Fix | Delete
try {
[3483] Fix | Delete
return unlock(stores[name].store).privateActions;
[3484] Fix | Delete
} catch (e) {
[3485] Fix | Delete
// unlock() throws an error the store was not locked – this means
[3486] Fix | Delete
// there no private actions are available
[3487] Fix | Delete
return {};
[3488] Fix | Delete
}
[3489] Fix | Delete
},
[3490] Fix | Delete
privateSelectorsOf: name => {
[3491] Fix | Delete
try {
[3492] Fix | Delete
return unlock(stores[name].store).privateSelectors;
[3493] Fix | Delete
} catch (e) {
[3494] Fix | Delete
return {};
[3495] Fix | Delete
}
[3496] Fix | Delete
}
[3497] Fix | Delete
});
[3498] Fix | Delete
return registryWithPlugins;
[3499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function