@samitouri / QOS-React / commits / 51f04fdbc1

Add checkpoint/rollback to ReactNativeReconcileTransaction (#7619)

Miller Medeiros committed Aug 30, 2016 at 15:42 UTC 51f04fdbc10041106eee45ca539d842bc74c5c80
1 file changed +13
src/renderers/native/ReactNativeReconcileTransaction.js
+13
@@ -97,6 +97,19 @@ var Mixin = {
97 return ReactUpdateQueue;
98 },
99
100 + /**
101 + * Save current transaction state -- if the return value from this method is
102 + * passed to `rollback`, the transaction will be reset to that state.
103 + */
104 + checkpoint: function() {
105 + // reactMountReady is the our only stateful wrapper
106 + return this.reactMountReady.checkpoint();
107 + },
108 +
109 + rollback: function(checkpoint) {
110 + this.reactMountReady.rollback(checkpoint);
111 + },
112 +
113 /**
114 * `PooledClass` looks for this, and will invoke this before allowing this
115 * instance to be reused.