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

just curious - why a 'type' parameter instead of separate functions #27

Closed
far-blue opened this issue Jun 2, 2018 · 2 comments
Closed

Comments

@far-blue
Copy link

far-blue commented Jun 2, 2018

Hi!

I really enjoyed @staltz's talk at AmsterdamJS yesterday but didn't have a chance to ask (just because I'm curious) why you chose a type parameter on a multi-behavioural function rather than separate functions start(), data() and end().

@staltz
Copy link
Member

staltz commented Jun 2, 2018

Hi! It's a lighter implementation. Object and 3 methods is more allocations than 1 function.

@staltz staltz closed this as completed Jun 2, 2018
@far-blue
Copy link
Author

far-blue commented Jun 2, 2018

ah, ok. I didn't realise the difference would be so great :)

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

No branches or pull requests

2 participants