1 | 'use strict';
|
2 | import { isFabric } from './PlatformChecker';
|
3 | import { runOnUI } from './threads';
|
4 |
|
5 | let VIEW_TAGS: number[] = [];
|
6 |
|
7 | export function removeFromPropsRegistry(viewTag: number) {
|
8 | VIEW_TAGS.push(viewTag);
|
9 | if (VIEW_TAGS.length === 1) {
|
10 | queueMicrotask(flush);
|
11 | }
|
12 | }
|
13 |
|
14 | function flush() {
|
15 | if (__DEV__ && !isFabric()) {
|
16 | throw new Error('[Reanimated] PropsRegistry is only available on Fabric.');
|
17 | }
|
18 | runOnUI(removeFromPropsRegistryOnUI)(VIEW_TAGS);
|
19 | VIEW_TAGS = [];
|
20 | }
|
21 |
|
22 | function removeFromPropsRegistryOnUI(viewTags: number[]) {
|
23 | 'worklet';
|
24 | global._removeFromPropsRegistry(viewTags);
|
25 | }
|