react / react-0.13.3 / examples / basic-commonjs / node_modules / reactify / node_modules / react-tools / src / browser / ReactPutListenerQueue.js
81152 views/**1* Copyright 2013-2014, Facebook, Inc.2* All rights reserved.3*4* This source code is licensed under the BSD-style license found in the5* LICENSE file in the root directory of this source tree. An additional grant6* of patent rights can be found in the PATENTS file in the same directory.7*8* @providesModule ReactPutListenerQueue9*/1011"use strict";1213var PooledClass = require('PooledClass');14var ReactBrowserEventEmitter = require('ReactBrowserEventEmitter');1516var assign = require('Object.assign');1718function ReactPutListenerQueue() {19this.listenersToPut = [];20}2122assign(ReactPutListenerQueue.prototype, {23enqueuePutListener: function(rootNodeID, propKey, propValue) {24this.listenersToPut.push({25rootNodeID: rootNodeID,26propKey: propKey,27propValue: propValue28});29},3031putListeners: function() {32for (var i = 0; i < this.listenersToPut.length; i++) {33var listenerToPut = this.listenersToPut[i];34ReactBrowserEventEmitter.putListener(35listenerToPut.rootNodeID,36listenerToPut.propKey,37listenerToPut.propValue38);39}40},4142reset: function() {43this.listenersToPut.length = 0;44},4546destructor: function() {47this.reset();48}49});5051PooledClass.addPoolingTo(ReactPutListenerQueue);5253module.exports = ReactPutListenerQueue;545556