UNPKG

736 BJavaScriptView Raw
1/**
2 * Copyright 2016-present, Facebook, Inc.
3 * All rights reserved.
4 *
5 * This source code is licensed under the BSD-style license found in the
6 * LICENSE file in the root directory of this source tree. An additional grant
7 * of patent rights can be found in the PATENTS file in the same directory.
8 *
9 *
10 */
11
12'use strict';
13
14var history = [];
15
16var ReactHostOperationHistoryHook = {
17 onHostOperation: function (operation) {
18 history.push(operation);
19 },
20 clearHistory: function () {
21 if (ReactHostOperationHistoryHook._preventClearing) {
22 // Should only be used for tests.
23 return;
24 }
25
26 history = [];
27 },
28 getHistory: function () {
29 return history;
30 }
31};
32
33module.exports = ReactHostOperationHistoryHook;
\No newline at end of file