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