How to use the ractive.Promise function in ractive

To help you get started, we’ve selected a few ractive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alumna / alumna / src / main.js View on Github external
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;
		};
github zenflow / ractive-isomorphic / lib / index.js View on Github external
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;