4 ms·
The function-based approach is kind of nice because you can use defer for cleanup, and you don’t have to write an entire struct and track state via props, etc.
by christophilus 3y ago
The function-based approach is kind of nice because you can use defer for cleanup, and you don’t have to write an entire struct and track state via props, etc. I kind of like this proposal.
- earthboundkid 3y agoThe interface version is nicer for consumers in a world where you can’t range over a function, but the function version is way easier to write, so once you can range over functions, the advantages of the interface versions mostly go away.