phaser-jsx
Version:
Use JSX in Phaser.
18 lines • 447 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.attachRef = attachRef;
/**
* Attaches game object ref.
*
* @param gameObject - Phaser game object.
* @param ref - Ref callback.
*/
function attachRef(gameObject, ref) {
if (typeof ref === 'function') {
ref(gameObject);
}
else if (ref && typeof ref === 'object') {
ref.current = gameObject;
}
}
//# sourceMappingURL=ref.js.map