refactor: expose scheduler for vapor
This commit is contained in:
parent
783d8b4d0d
commit
9d89d7ab27
|
@ -488,3 +488,4 @@ export const DeprecationTypes = (
|
||||||
// change without notice between versions. User code should never rely on them.
|
// change without notice between versions. User code should never rely on them.
|
||||||
|
|
||||||
export { baseNormalizePropsOptions, resolvePropValue } from './componentProps'
|
export { baseNormalizePropsOptions, resolvePropValue } from './componentProps'
|
||||||
|
export { type SchedulerJob, queueJob } from './scheduler'
|
||||||
|
|
|
@ -24,6 +24,9 @@ export enum SchedulerJobFlags {
|
||||||
DISPOSED = 1 << 3,
|
DISPOSED = 1 << 3,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
export interface SchedulerJob extends Function {
|
export interface SchedulerJob extends Function {
|
||||||
id?: number
|
id?: number
|
||||||
/**
|
/**
|
||||||
|
@ -91,6 +94,9 @@ function findInsertionIndex(id: number) {
|
||||||
return start
|
return start
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @internal for runtime-vapor only
|
||||||
|
*/
|
||||||
export function queueJob(job: SchedulerJob): void {
|
export function queueJob(job: SchedulerJob): void {
|
||||||
if (!(job.flags! & SchedulerJobFlags.QUEUED)) {
|
if (!(job.flags! & SchedulerJobFlags.QUEUED)) {
|
||||||
const jobId = getId(job)
|
const jobId = getId(job)
|
||||||
|
|
|
@ -61,10 +61,6 @@ interface ComponentInternalOptions {
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
__hmrId?: string
|
__hmrId?: string
|
||||||
/**
|
|
||||||
* Compat build only, for bailing out of certain compatibility behavior
|
|
||||||
*/
|
|
||||||
__isBuiltIn?: boolean
|
|
||||||
/**
|
/**
|
||||||
* This one should be exposed so that devtools can make use of it
|
* This one should be exposed so that devtools can make use of it
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
import { ReactiveEffect } from '@vue/reactivity'
|
import { ReactiveEffect } from '@vue/reactivity'
|
||||||
import {
|
import { type SchedulerJob, queueJob } from '@vue/runtime-core'
|
||||||
type SchedulerJob,
|
|
||||||
queueJob,
|
|
||||||
} from '../../../runtime-core/src/scheduler'
|
|
||||||
import { currentInstance } from './component'
|
import { currentInstance } from './component'
|
||||||
|
|
||||||
export function renderEffect(fn: () => void): void {
|
export function renderEffect(fn: () => void): void {
|
||||||
|
|
Loading…
Reference in New Issue