Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Improvement: Inferring schema types on Components #249

Open
brmenchl opened this issue Aug 17, 2020 · 3 comments
Open

Improvement: Inferring schema types on Components #249

brmenchl opened this issue Aug 17, 2020 · 3 comments

Comments

@brmenchl
Copy link

Hey all, I'm working on a Typescript/React/Ecsy side project in the vein of react-ecs, and I'm running into weird typing issues that are hard to resolve based on use of class constructors and static properties. For now I've been able to get some pretty good workarounds.

I was working on fixing up Component types, primarily around getting inferred types to work on schema properties (Here's where I'm at right now).

As you can see, this allows you to get type inference on your schema properties (e.g. Position.x, Position.y). Let me know if this looks good and I can make a PR.

@cfortuner
Copy link

+1 to this approach! This really helps.

@AlvinThorn008
Copy link

Yes, please make the PR

@brmenchl
Copy link
Author

Oh wow I completely forgot about this! Yup I'll get started tomorrow.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants