Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve API clarity of createEntity #124

Closed
hmans opened this issue Sep 22, 2022 · 1 comment · Fixed by #125
Closed

Improve API clarity of createEntity #124

hmans opened this issue Sep 22, 2022 · 1 comment · Fixed by #125
Assignees

Comments

@hmans
Copy link
Owner

hmans commented Sep 22, 2022

createEntity should always only accept a single argument that must satisfy the world type. The current API allows for passing multiple partials, which is fun, but is a little too confusing (and requires us to loosen types a little too much.) For a component factory-centric approach, we can instead do this:

const entity = createEntity({
  ...position(0, 0),
  ...velocity(10, 0),
});
@hmans hmans self-assigned this Sep 22, 2022
@hmans hmans linked a pull request Sep 24, 2022 that will close this issue
@hmans hmans added this to the Miniplex 0.11 milestone Sep 24, 2022
@hmans
Copy link
Owner Author

hmans commented Sep 25, 2022

Coming in 0.11.

@hmans hmans closed this as completed Sep 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant