Skip to content

Provide example of signal events being used outside of a store #5054

@undsoft

Description

@undsoft

Information

Events source code contains an example of how Events can be used outside of a store:

* \@Component({ /* ... *\/ })
* class Counter {
* readonly #events = inject(Events);
*
* constructor() {
* this.#events
* .on(increment)
* .pipe(takeUntilDestroyed())
* .subscribe(() => /* handle increment event *\/);
* }
* }

It may be a good idea to include it in documentation as well, because it is not immediately obvious you can do this.

Documentation page

No response

I would be willing to submit a PR to fix this issue

  • Yes
  • No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions