1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 | import CallbackQueue from 'react/lib/CallbackQueue';
|
11 | import PooledClass from 'react/lib/PooledClass';
|
12 | import Transaction from 'react/lib/Transaction';
|
13 | import {extend} from 'lodash';
|
14 |
|
15 | const ON_BLESSED_READY_QUEUEING = {
|
16 | initialize: function () {
|
17 | this.reactMountReady.reset();
|
18 | },
|
19 | close: function () {
|
20 | this.reactMountReady.notifyAll();
|
21 | }
|
22 | };
|
23 |
|
24 | function ReactBlessedReconcileTransaction() {
|
25 | this.reinitializeTransaction();
|
26 | this.reactMountReady = CallbackQueue.getPooled(null);
|
27 | }
|
28 |
|
29 | const Mixin = {
|
30 | getTransactionWrappers: function() {
|
31 | return [ON_BLESSED_READY_QUEUEING];
|
32 | },
|
33 | getReactMountReady: function() {
|
34 | return this.reactMountReady;
|
35 | },
|
36 | destructor: function() {
|
37 | CallbackQueue.release(this.reactMountReady);
|
38 | this.reactMountReady = null;
|
39 | }
|
40 | };
|
41 |
|
42 | extend(
|
43 | ReactBlessedReconcileTransaction.prototype,
|
44 | Transaction.Mixin,
|
45 | Mixin
|
46 | );
|
47 |
|
48 | PooledClass.addPoolingTo(ReactBlessedReconcileTransaction);
|
49 |
|
50 | export default ReactBlessedReconcileTransaction;
|