DEV Community

Discussion on: Yielding Bells 🔔 - generators in PHP

Collapse
dawiddahl profile image
Dawid Dahl

Really like generators! The concept really clicked when I first heard them described as "pausable functions". Also, that you can get information in and out at any times is really cool, like opening a portal between different dimensions. 🌌

When I used Redux Saga for frontend state management for a project I got to go more in depth with them, really fun!

Collapse
andersbjorkland profile image
Anders Björkland Author

Plausible functions are a great way to put it! 💡

I was completely taken off guard the first time I saw yield in a code base. I just thought of them as alternative to returning arrays until I learned about what generators are.

I haven't used them a lot but now I know what I'm looking at in third party code! 😅