UNPKG

react-native-filament

Version:

A real-time physically based 3D rendering engine for React Native

20 lines (19 loc) 534 B
import React from 'react'; let touchHandlers = {}; let id = 0; /** * Internal context for holding touch handlers which will be invoked on the FilamentView. * @private */ export const TouchHandlerContext = /*#__PURE__*/React.createContext({ touchHandlers, addTouchHandler: handler => { const handlerId = id++; touchHandlers[handlerId] = handler; return () => { delete touchHandlers[handlerId]; }; } }); export const getTouchHandlers = () => touchHandlers; //# sourceMappingURL=TouchHandlerContext.js.map