Comments (3)
Would also love to see this addition. If we're adding many events, we would rather not have to instantiate an instance of each listener and then pass them into the emitter. Rather, let us pass in a list of string aliases and have the container lazy load them when / if needed:
$emitter->addListener('some.event', \Some\Listener::class);
$emitter->addListener('different.event', \SomeOther\Listener::class);
from event.
See #61!
from event.
Just released a small package right here: refinery29/league-lazy-event:0.1.0
!
from event.
Related Issues (20)
- Double invoked events with name same as their classname HOT 5
- How do you remove listeners?
- [docs] Typo in event/2.0/events/classes.md
- [docs] Typo in event/2.0/generator/trait.md
- Additional Arguments throw exception when using AbstractListener HOT 7
- Upcoming PSR HOT 3
- waitFor method HOT 4
- Ditch EventInterface HOT 5
- What is this repository for? HOT 1
- BufferedEmitter as service HOT 1
- Has this package been abandoned? HOT 2
- Fatal error: Uncaught Error: Class 'League\Event\Emitter' not found HOT 1
- New release? HOT 6
- Add the ability to have wildcard listener to be fired before all other listeners HOT 1
- Upgrade from 2 to 3 documentation is... incomplete... HOT 1
- What would be proper approach to add information to an event? HOT 2
- Stoppable Events HOT 5
- Is it possible to provide a working example? HOT 1
- Documentation issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from event.