Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
Altiva.getComponent = function ( url )
{
return new Ractive.Promise( function ( fulfil, reject )
{
var xhr, onload, loaded;
xhr = new XMLHttpRequest();
xhr.open( 'GET', url );
onload = function ()
{
if ( ( xhr.readyState !== 4 ) || loaded )
{
return;
}
fulfil( xhr.responseText );
loaded = true;
};
var ri = {
Site: require('./Site'),
Page: require('./Page'),
Component: require('./Component'),
Promise: require('ractive').Promise,
errors: require('./errors'),
_: require('lodash'),
Ractive: require('ractive')
};
module.exports = ri;