Better HN
top
new
best
ask
show
jobs
Log in
Sign up
How to Use a Generator Function as a Constructor | Better HN
How to Use a Generator Function as a Constructor
(medium.com)
1 points · by
ruanyf
· 10y ago · 4 comments
Comments
[–]
slikts
10y ago
Just, why… Pass in a parameter if you need to set the state, no need to mess with the context.
[–]
jaceju
10y ago
Is there any example for real cases? I don't know the meaning of this workaround.
[–]
gotofritz
10y ago
Yes, I was going to ask the same. What is the point of this? What problem does it solve?
[–]
geirman
10y ago
indeed, why would anyone ever want or need to do this?