Expose dirtied func in Javascript bindings (#842)

Summary:
Yoga currently has the concept of a 'dirtied func', which is called when a Node becomes dirty, which can be useful to trigger a repaint. This PR exposes that functionality in the Javascript bindings.
Pull Request resolved: https://github.com/facebook/yoga/pull/842

Reviewed By: SidharthGuglani

Differential Revision: D13847093

Pulled By: davidaurelio

fbshipit-source-id: 41913abd6eedc46ee7d66929140e08a084f23972
This commit is contained in:
Reinier Hartog
2019-01-31 09:06:57 -08:00
committed by Facebook Github Bot
parent 4a6b1e19b8
commit 8691cdaed6
4 changed files with 208 additions and 1 deletions

View File

@@ -161,6 +161,15 @@ class Node {
Size callMeasureFunc(double width, int widthMode, double height, int heightMode) const;
public: // Dirtied func mutators
void setDirtiedFunc(nbind::cbFunction & dirtiedFunc);
void unsetDirtiedFunc(void);
public: // Dirtied func inspectors
void callDirtiedFunc(void) const;
public: // Dirtiness accessors
void markDirty(void);
@@ -194,5 +203,5 @@ class Node {
YGNodeRef m_node;
std::unique_ptr<nbind::cbFunction> m_measureFunc;
std::unique_ptr<nbind::cbFunction> m_dirtiedFunc;
};