UNPKG

journaly

Version:

A simple pub-sub library project

35 lines 1.6 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Journaly = void 0; const publisherSubscriber_1 = require("./publisherSubscriber"); const publisherSubscriberWithMemory_1 = require("./publisherSubscriberWithMemory"); const senderReceiver_1 = require("./senderReceiver"); const senderReceiverWithMemory_1 = require("./senderReceiverWithMemory"); const subjectObserver_1 = require("./subjectObserver"); const subjectObserverWithMemory_1 = require("./subjectObserverWithMemory"); class Journaly { // eslint-disable-next-line @typescript-eslint/no-empty-function constructor() { } static newJournaly(options) { if (options) { if (options.hasTopic && options.multiple) if (options.hasMemory) return new publisherSubscriberWithMemory_1.PublisherSubscriberWithMemory(); else return new publisherSubscriber_1.PublisherSubscriber(); if (options.multiple) if (options.hasMemory) return new subjectObserverWithMemory_1.SubjectObserverWithMemory(); else return new subjectObserver_1.SubjectObserver(); if (options.hasTopic) if (options.hasMemory) return new senderReceiverWithMemory_1.SenderReceiverWithMemory(); else return new senderReceiver_1.SenderReceiver(); } return new senderReceiver_1.SenderReceiver(); } } exports.Journaly = Journaly; //# sourceMappingURL=journaly.js.map