UNPKG

668 BJavaScriptView Raw
1'use strict';
2
3import { ReanimatedError } from "./errors.js";
4import { isFabric } from "./PlatformChecker.js";
5import { runOnUI } from "./threads.js";
6let VIEW_TAGS = [];
7export function removeFromPropsRegistry(viewTag) {
8 VIEW_TAGS.push(viewTag);
9 if (VIEW_TAGS.length === 1) {
10 queueMicrotask(flush);
11 }
12}
13function 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}
20function removeFromPropsRegistryOnUI(viewTags) {
21 'worklet';
22
23 global._removeFromPropsRegistry(viewTags);
24}
25//# sourceMappingURL=PropsRegistry.js.map
\No newline at end of file