1234567891011121314151617 |
- 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)
- })
- })
- }
- }
|