UNPKG

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