import * as RE from 'rogue-engine';

export default class AsyncLoader {
	loadStaticText(filepath) { 
		return new Promise((success, failure) => {
			fetch(RE.getStaticPath(filepath)).then(result => {
				result.text().then(text => {
					success(text)
				}, error => {
					failure(error)
				})
			}, error => {
				failure(error)
			})
		})
	}
}