1 #pragma once 2 3 #include <jsi/jsi.h> 4 #include <stdio.h> 5 #include <functional> 6 #include <map> 7 #include <memory> 8 9 namespace reanimated { 10 11 using namespace facebook; 12 13 class MutableValue; 14 15 class LayoutAnimationsProxy { 16 public: 17 LayoutAnimationsProxy( 18 std::function<void(int, jsi::Object newProps)> _notifyAboutProgress, 19 std::function<void(int, bool)> _notifyAboutEnd); 20 21 void 22 startObserving(int tag, std::shared_ptr<MutableValue> sv, jsi::Runtime &rt); 23 void stopObserving(int tag, bool finished); 24 void notifyAboutCancellation(int tag); 25 26 private: 27 std::function<void(int, jsi::Object newProps)> notifyAboutProgress; 28 std::function<void(int, bool)> notifyAboutEnd; 29 std::map<int, std::shared_ptr<MutableValue>> observedValues; 30 }; 31 32 } // namespace reanimated 33