Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
39 lines
1.5 KiB
JavaScript
39 lines
1.5 KiB
JavaScript
'use strict';
|
|
var $ = require('../internals/export');
|
|
var getBuiltIn = require('../internals/get-built-in');
|
|
var call = require('../internals/function-call');
|
|
var anObject = require('../internals/an-object');
|
|
var isConstructor = require('../internals/is-constructor');
|
|
var getIterator = require('../internals/get-iterator');
|
|
var getIteratorMethod = require('../internals/get-iterator-method');
|
|
var getMethod = require('../internals/get-method');
|
|
var iterate = require('../internals/iterate');
|
|
var wellKnownSymbol = require('../internals/well-known-symbol');
|
|
|
|
var $$OBSERVABLE = wellKnownSymbol('observable');
|
|
|
|
// `Observable.from` method
|
|
// https://github.com/tc39/proposal-observable
|
|
$({ target: 'Observable', stat: true, forced: true }, {
|
|
from: function from(x) {
|
|
var C = isConstructor(this) ? this : getBuiltIn('Observable');
|
|
var observableMethod = getMethod(anObject(x), $$OBSERVABLE);
|
|
if (observableMethod) {
|
|
var observable = anObject(call(observableMethod, x));
|
|
return observable.constructor === C ? observable : new C(function (observer) {
|
|
return observable.subscribe(observer);
|
|
});
|
|
}
|
|
var iteratorMethod = getIteratorMethod(x);
|
|
// validate that x is iterable synchronously during `from()` call
|
|
if (!iteratorMethod) getIterator(x);
|
|
return new C(function (observer) {
|
|
iterate(getIterator(x, iteratorMethod), function (it, stop) {
|
|
observer.next(it);
|
|
if (observer.closed) return stop();
|
|
}, { IS_ITERATOR: true, INTERRUPTED: true });
|
|
observer.complete();
|
|
});
|
|
}
|
|
});
|