1 | import { configure } from "mobx"
|
2 |
|
3 | export function defaultNoopBatch(callback: () => void) {
|
4 | callback()
|
5 | }
|
6 |
|
7 | export 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 |
|
19 | export const isObserverBatched = () => {
|
20 | if ("production" !== process.env.NODE_ENV) {
|
21 | console.warn("[MobX] Deprecated")
|
22 | }
|
23 |
|
24 | return true
|
25 | }
|