Comments (4)
It doesn't really change between ES5/ESM. In either situation pc.app
is null until it isn't, so pc.app.fire('someEvent')
works once app
is available. It's more a question of whether it should be exported
from engine.
Definitely used a lot by users, as it is the most common way to reference apps outside of scripts.
from engine.
To clarify, it is actually exported but it's null until the app has been initialised. Updated comment to reflect this
from engine.
Here is one example of a use case:
- Some external script wants to subscribe or fire a global event on app:
pc.app.fire('someEvent');
. - During development in the console it is convenient to do something like:
pc.app.root.findByName('Entity')
for inspecting entities and so on.
Do these cases still work with ESM?
from engine.
Related Issues (20)
- Gizmo movement plane HOT 5
- Gslang in engine examples runs our of memory in Safari
- Not loading TypeScript types definitions due to problematic "exports" field in package.json HOT 2
- Re-loading cubemaps fail to load associated textures HOT 2
- Ammo.js "table index is out of bounds" following Trigger destruction
- [Examples] `npm run develop` slower/bigger than it has to be HOT 1
- Question on multi-app HOT 2
- TypeError: e is not a constructor on loading glb model from ceisium HOT 2
- Inconsistencies with Anim component.
- Application crash HOT 2
- Some glb files are not rendered correctly HOT 1
- Private Vercel bot Previews HOT 1
- Cannot create collision mesh using accessors
- Gizmo axis color does not restore when enabled (dsiabled=false)
- Neutral tonemapping does not implement exposure. HOT 1
- Gizmo keep selected when rotating camera
- Particles depend on camera angle HOT 3
- Why is there no Chinese documentation? HOT 3
- Is it possible to use IndexedDB to improve the loading speed of secondary renders? HOT 2
- Import URL resolution HOT 10
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from engine.