Skip to content

Create a better communication config for event emitters #2498

@barak007

Description

@barak007

Example of usage in a service

class MyService{
    mySignal = new Signal()
}

Example of config in feature

export default class BoardCapabilities extends Feature<"F1"> {
  id = "F1" as const;
  dependencies = [];
  api = {
    myService: Service.withType<MyService>()
      .defineEntity(processingEnv)
      .allowRemoteAccess(asyncSignal("mySignal")),
  };
}

The idea is one function asyncSignal (in this example the name can be changed) should define all the on/off/sub/unsub.... on the emitter.
this will save a lot of boilerplate code in all services and make the entire Signal an AsyncSignal

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