microevent.ts

  • Version 0.2.1
  • Published
  • 8.9 kB
  • No dependencies
  • MIT license

Install

npm i microevent.ts
yarn add microevent.ts
pnpm add microevent.ts

Overview

Zero cost events

Index

Classes

class Event

class Event<EventPayload> implements EventInterface<EventPayload> {}

    constructor

    constructor();

      property dispatch

      dispatch: (payload: EventPayload) => void;

        property hasHandlers

        hasHandlers: boolean;

          method addHandler

          addHandler: <T>(
          handler: EventInterface.HandlerInterface<EventPayload, T>,
          context?: T
          ) => Event<EventPayload>;

            method isHandlerAttached

            isHandlerAttached: <T>(
            handler: EventInterface.HandlerInterface<EventPayload, T>,
            context?: T
            ) => boolean;

              method removeHandler

              removeHandler: <T>(
              handler: EventInterface.HandlerInterface<EventPayload, T>,
              context?: T
              ) => Event<EventPayload>;

                Interfaces

                interface EventInterface

                interface EventInterface<EventPayload> {}

                  method addHandler

                  addHandler: <T>(
                  handler: EventInterface.HandlerInterface<EventPayload, T>,
                  context?: T
                  ) => EventInterface<EventPayload>;

                    method removeHandler

                    removeHandler: <T>(
                    handler: EventInterface.HandlerInterface<EventPayload, T>,
                    context?: T
                    ) => EventInterface<EventPayload>;

                      Namespaces

                      namespace EventInterface

                      namespace EventInterface {}

                        interface HandlerInterface

                        interface HandlerInterface<EventPayload, T> {}

                          call signature

                          (payload: EventPayload, context: T): void;

                            Package Files (3)

                            Dependencies (0)

                            No dependencies.

                            Dev Dependencies (6)

                            Peer Dependencies (0)

                            No peer dependencies.

                            Badge

                            To add a badge like this onejsDocs.io badgeto your package's README, use the codes available below.

                            You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/microevent.ts.

                            • Markdown
                              [![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/microevent.ts)
                            • HTML
                              <a href="https://www.jsdocs.io/package/microevent.ts"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>