2017-04-12 06:33:37 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
// Make this available to both AMD and CJS environments
|
2023-05-20 12:26:49 +00:00
|
|
|
define(function (require, exports, module) {
|
2017-04-12 06:33:37 +00:00
|
|
|
// Dependencies
|
2024-11-14 21:43:33 +00:00
|
|
|
const React = require("resource://devtools/client/shared/vendor/react.js");
|
2017-04-12 06:33:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Create React factories for given arguments.
|
|
|
|
* Example:
|
|
|
|
* const {
|
|
|
|
* Tabs,
|
|
|
|
* TabPanel
|
2017-09-27 05:12:13 +00:00
|
|
|
* } = createFactories(require("devtools/client/shared/components/tabs/Tabs"));
|
2017-04-12 06:33:37 +00:00
|
|
|
*/
|
|
|
|
function createFactories(args) {
|
2018-06-01 10:36:09 +00:00
|
|
|
const result = {};
|
|
|
|
for (const p in args) {
|
2017-04-12 06:33:37 +00:00
|
|
|
result[p] = React.createFactory(args[p]);
|
|
|
|
}
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
createFactories,
|
|
|
|
};
|
|
|
|
});
|