Skip to content

Commit

Permalink
Remove LazyListenerFactory from readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sunkan committed Oct 24, 2023
1 parent 0845bce commit c21c87f
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ $provider->listen(Event::class, $listener);
### `ContainerListenerProvider`

Use a Psr-11 container to lazy load the callbacks.
This is cleaner why to do lazy loading then the `LazyListenerFactory`

```php
use Circli\EventDispatcher\ListenerProvider\ContainerListenerProvider;
Expand Down Expand Up @@ -105,20 +104,3 @@ $provider->listen(RandomEvent::class, $listener, function ($event) {
return ifRandomExternalThingIsTrue();
});
```


## `LazyListenerFactory`

We also include a factory class to create lazy loaded handlers.

```php
use Circli\EventDispatcher\LazyListenerFactory;
use Circli\EventDispatcher\ListenerProvider\DefaultProvider;
use Psr\Container\ContainerInterface;

$lazyFactory = new LazyListenerFactory($psr11Container);

$listener = $lazyFactory->lazy('SomeService');
$provider = new DefaultProvider();
$provider->listen(Event::class, $listener);
```

0 comments on commit c21c87f

Please sign in to comment.