Using callbacks to prevent code duplication
– doeken.org - submitted by Doeke Norg – Edit
DRY up code by deferring specifics to a callback.
Read more [doeken.org]
Posts tagged with callbacks
– doeken.org - submitted by Doeke Norg – Edit
DRY up code by deferring specifics to a callback.
Read more [doeken.org]
– twitter.com – Edit
? Did you know you could use the afterCreating and lots of other "after" callbacks on Eloquent Factories to create additional models in Laravel? https://t.co/XejFph55zO #Laravel #PHP pic.twitter.com/oc8BfpEPqN
— Dries Vints (@driesvints) May 15, 2018
Read more [twitter.com]
Join 9,500+ smart developers
Get my monthly newsletter with what I learn from running Spatie, building Oh Dear, and maintaining 300+ open source packages. Practical takes on Laravel, PHP, and AI that you can actually use.
No spam. Unsubscribe anytime. You can also follow me on X.
"As a Laravel developer, this is the one newsletter I most look forward to. Freek has a talent for distilling packages or techniques down to something immediately useful - one tip can save you hours and even weeks. It's concise and practical and highly relevant."
– Edit
JavaScript practically requires callback functions to do anything asynchronous. Unless you’re talking about generators, you really can’t get away from them. Callbacks are everywhere.http://derickbailey.com/2016/02/15/what-do-you-name-the-callback-function/...
I do use different names for the callback parameter, depending on the circumstance. I believe naming is important as it provides a set of expectations. If your code breaks the expectations of the name, people will be confused and it will cause problems.