Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getComponentByName: function(name) {
return this.components[name];
},
start: function(rootProps, container) {
var component = this.getComponentByName(rootProps.component),
content;
if (!component) {
return;
}
React.renderComponent(component(_.clone(rootProps)), container);
}
};
// Enable Node.js compatibility
if (typeof module !== 'undefined' && module.exports) {
var React = require('react-tools').React,
_ = require('underscore'),
$ = require('jquery');
module.exports = Fresh;
}
Fresh.serialize = {
getPropsFromQueryString: function(queryString) {
var props = {};
if (queryString.length) {
var pairs = queryString.split('&'),
parts,
key,
value;
for (var i = 0; i < pairs.length; i++) {
parts = pairs[i].split('=');
key = parts[0];