UNPKG

643 BPlain TextView Raw
1import { configure } from "mobx"
2
3export function defaultNoopBatch(callback: () => void) {
4 callback()
5}
6
7export function observerBatching(reactionScheduler: any) {
8 if (!reactionScheduler) {
9 reactionScheduler = defaultNoopBatch
10 if ("production" !== process.env.NODE_ENV) {
11 console.warn(
12 "[MobX] Failed to get unstable_batched updates from react-dom / react-native"
13 )
14 }
15 }
16 configure({ reactionScheduler })
17}
18
19export const isObserverBatched = () => {
20 if ("production" !== process.env.NODE_ENV) {
21 console.warn("[MobX] Deprecated")
22 }
23
24 return true
25}