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

Collection made generic & type to Group.children #655

Merged
merged 1 commit into from
Aug 14, 2022

Conversation

alper-batioglu
Copy link
Contributor

@alper-batioglu alper-batioglu commented Aug 14, 2022

Group.children if I am not mistaken is the collection of items added by the Group.Add method. So they are TwoElements.
With this assumption I made Collection generic. (with default of any in order to prevent affecting other usages)
And also defined Children type as a collection of TwoElements. And also Group.children as Children.

this made usages possible like,
this.root.children.forEach(child => this.root.position.blablabla

I am still thinking of
export class Children extends Collection<Shape> ...
but children is filled by Add and it accepts TwoElement; so I think i will stick with that.

@jonobr1
Copy link
Owner

jonobr1 commented Aug 14, 2022

Thank you for the improvements!!

@jonobr1 jonobr1 merged commit 18dc99b into jonobr1:dev Aug 14, 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 this pull request may close these issues.

2 participants