Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(loop): export flush methods and types #2580

Merged
merged 3 commits into from Oct 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/fiber/src/core/index.tsx
Expand Up @@ -17,7 +17,7 @@ import {
privateKeys,
} from './store'
import { createRenderer, extend, Root } from './renderer'
import { createLoop, addEffect, addAfterEffect, addTail } from './loop'
import { createLoop, addEffect, addAfterEffect, addTail, flushGlobalEffects } from './loop'
import { getEventPriority, EventManager, ComputeFunction } from './events'
import {
is,
Expand Down Expand Up @@ -548,6 +548,7 @@ export {
addEffect,
addAfterEffect,
addTail,
flushGlobalEffects,
getRootState,
act,
roots as _roots,
Expand Down
2 changes: 1 addition & 1 deletion packages/fiber/src/core/loop.ts
Expand Up @@ -2,7 +2,7 @@ import * as THREE from 'three'
import { Root } from './renderer'
import { RootState, Subscription } from './store'

type GlobalRenderCallback = (timeStamp: number) => void
export type GlobalRenderCallback = (timeStamp: number) => void
type SubItem = { callback: GlobalRenderCallback }

function createSubs(callback: GlobalRenderCallback, subs: Set<SubItem>): () => void {
Expand Down
3 changes: 2 additions & 1 deletion packages/fiber/src/index.tsx
Expand Up @@ -13,8 +13,9 @@ export type {
RootState,
} from './core/store'
export type { ThreeEvent, Events, EventManager, ComputeFunction } from './core/events'
export { createEvents } from './core/events'
export type { ObjectMap, Camera } from './core/utils'
export * from './web/Canvas'
export { createEvents } from './core/events'
export { createPointerEvents as events } from './web/events'
export type { GlobalRenderCallback, GlobalEffectType } from './core/loop'
export * from './core'
2 changes: 2 additions & 0 deletions packages/fiber/src/native.tsx
Expand Up @@ -13,7 +13,9 @@ export type {
RootState,
} from './core/store'
export type { ThreeEvent, Events, EventManager, ComputeFunction } from './core/events'
export { createEvents } from './core/events'
export type { ObjectMap, Camera } from './core/utils'
export * from './native/Canvas'
export { createTouchEvents as events } from './native/events'
export type { GlobalRenderCallback, GlobalEffectType } from './core/loop'
export * from './core'