Skip to content
This repository has been archived by the owner on Jun 8, 2023. It is now read-only.

Releases: noel-archive/Lilith

4.0.1

01 Jun 19:03
Compare
Choose a tag to compare

Fixes

  • Expose Container.emitters in typings

4.0.0

01 Jun 19:01
Compare
Choose a tag to compare

Additions

  • Subscriptions API πŸŽ‰
  • APIs for Components and Services πŸŽ‰

Deprecations

  • Container.runInjections(target) has been replaced with Container.addInjections(target).

APIs for Components and Services: What is that?

It's just a external class named api that has references to the container.

Subscriptions API: What is it?

It's a way to have methods emitted from component/service (or child!) components without external libraries or any implementation. You must register your emitter though or it'll not work! An example would be:

components/some-dummy.component.ts

import { Component, Subscribe } from '@augu/lilith';

@Component({ priority: 0, name: 'some-dummy' })
export default class MyDummyComponent {
   @Subscribe('some-event', 'a-event-emitter', false)
   onSomeEvent(a: string) {
       console.log('received: ' + a);
   }
}

main.ts

import { Container } from '@augu/lilith';
import { EventEmitter } from 'events';

const container = new Container({
   componentsDir: 'find your components here :D'
});

const emitter = new EventEmitter();
container.addEmitter('a-event-emitter', emitter);
(async() => {
    await container.load();
    emitter.emit('some-event', 'uwudog');
})();

3.0.3

21 May 22:47
Compare
Choose a tag to compare

Fixes

  • Container.$ref(value): any typings

Additions

  • Container.find(func, thisArg?): any | null function