UNPKG

svelte-phaser

Version:

Create Phaser 3 games with Svelte 3

13 lines 370 B
import { getGame } from '../getGame'; export function coroutine(callback) { const game = getGame(); const generator = callback(); const loopFn = () => { const result = generator.next(); if (result.done) { game.events.off('step', loopFn); } }; game.events.on('step', loopFn); } //# sourceMappingURL=coroutine.js.map