chore(lib/react/native/patches): refactor to one instead patch
This commit is contained in:
parent
180b8b858d
commit
7b3ede1904
1 changed files with 4 additions and 6 deletions
|
|
@ -1,19 +1,17 @@
|
|||
import { after, before } from '@revenge-mod/patcher'
|
||||
import { instead } from '@revenge-mod/patcher'
|
||||
import { ReactNative } from '..'
|
||||
import { sAfterRunApplication, sBeforeRunApplication } from './_internal'
|
||||
|
||||
before(ReactNative.AppRegistry, 'runApplication', args => {
|
||||
instead(ReactNative.AppRegistry, 'runApplication', function (args, orig) {
|
||||
for (const cb of sBeforeRunApplication)
|
||||
try {
|
||||
cb()
|
||||
} catch {}
|
||||
return args
|
||||
})
|
||||
|
||||
after(ReactNative.AppRegistry, 'runApplication', res => {
|
||||
Reflect.apply(orig, this, args)
|
||||
|
||||
for (const cb of sAfterRunApplication)
|
||||
try {
|
||||
cb()
|
||||
} catch {}
|
||||
return res
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue