chore(lib): use asap function to queue tasks
This commit is contained in:
parent
f1e94fe634
commit
1598a4940c
2 changed files with 4 additions and 9 deletions
|
|
@ -11,7 +11,7 @@ import {
|
|||
} from '@revenge-mod/modules/finders/lookup'
|
||||
import { waitForModules } from '@revenge-mod/modules/finders/wait'
|
||||
import { getModuleDependencies } from '@revenge-mod/modules/metro/utils'
|
||||
import { noop } from '@revenge-mod/utils/callback'
|
||||
import { asap, noop } from '@revenge-mod/utils/callback'
|
||||
import { cached, cacheFilterResultForId } from '../../../modules/src/caches'
|
||||
import { FilterResultFlags } from '../../../modules/src/finders/_internal'
|
||||
import type {
|
||||
|
|
@ -162,7 +162,7 @@ waitForModules(byStore(), (store, id) => {
|
|||
|
||||
cached.then(cached => {
|
||||
if (!cached)
|
||||
setImmediate(() => {
|
||||
asap(() => {
|
||||
const lookup = lookupModules(byStore(), {
|
||||
uninitialized: true,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
* This is especially useful for blacklisting exports that cannot be patched.
|
||||
*/
|
||||
|
||||
import { asap } from './callback'
|
||||
import { getCurrentStack } from './error'
|
||||
import { pTargets } from './patches/proxy'
|
||||
|
||||
|
|
@ -141,13 +142,7 @@ export function proxify<T>(signal: () => T, options?: ProxifyOptions): T {
|
|||
// Prevent race conditions where proxified values with a self modifying signal gets called,
|
||||
// modifying the original value to a non-proxified value, causing subsequent destructure() calls to fail
|
||||
|
||||
(
|
||||
// biome-ignore format: Don't format this
|
||||
// @ts-expect-error: Internal function, not available in all environments
|
||||
HermesInternal.enqueueJob ??
|
||||
globalThis.setImmediate ??
|
||||
((x: () => void) => x())
|
||||
)(() => {
|
||||
asap(() => {
|
||||
if (unproxifyFromHint(hint) == null)
|
||||
DEBUG_warnNullishProxifiedValue()
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue