Decorators

Secluded

A decorator that applies unit to the component's property by unit identifier or unit name.

Generic Type:

T = any

Args:

(
  arg: privateNotesKey
)

Return Type:

(target: any, propertyKey: PropertyKey) => void

Usage example:

....

@Component({
...
})
export class HeaderComponent {

  // getting unit by key
  @Secluded(APP_HUB_KEY)
  private app: Unit<AppNotes, AppChildNotes>;

  // getting unit by unit name
  @Secluded('about')
  private about: Unit<AboutNotes>;
}

Last updated