JaimeGensler / thyseus

An archetypal Entity Component System, built entirely in Typescript
MIT License
74 stars 3 forks source link

[CLEANUP] Investigate emplace pattern #65

Open JaimeGensler opened 11 months ago

JaimeGensler commented 11 months ago

We use a fetch-or-create pattern pretty much everywhere - resources, events, threads, components. The exact way we do this is a little different everywhere, too.

Ideally, we could make a helper function for this that takes away a lot of the hassle (like the emplace proposal). At the very least, we should unify around a common pattern of what this code looks like.