From 9e987fbe7fed088460b2fd98fc43c6b51081a571 Mon Sep 17 00:00:00 2001 From: Saad Date: Fri, 13 Sep 2024 19:53:46 -0400 Subject: [PATCH 1/4] update --- .github/workflows/node.js.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 5678c94..32b1719 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -45,17 +45,15 @@ jobs: - run: npm install - run: npm run build - - name: Publish to npm dry-run + - name: Authenticate with npm env: - NPM_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - npm publish --dry-run + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: echo "//registry.npmjs.org/:_authToken=${NODE_AUTH_TOKEN}" > ~/.npmrc + + - name: Run npm publish dry run + run: npm run npm:publish:dry-run - name: Publish to npm - if: github.ref == 'refs/heads/master' && github.event_name == 'push' env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - run: | - echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc - npm publish + run: npm run npm:publish From f3703a96afbcbd5a1482b8c4230f37b79d43ef6d Mon Sep 17 00:00:00 2001 From: Saad Date: Sat, 26 Oct 2024 20:57:14 -0400 Subject: [PATCH 2/4] update updated docs --- src/patterns/observer/Notifier.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/patterns/observer/Notifier.js b/src/patterns/observer/Notifier.js index 3fd112f..a3cfaa3 100755 --- a/src/patterns/observer/Notifier.js +++ b/src/patterns/observer/Notifier.js @@ -47,7 +47,7 @@ class Notifier { constructor() {} /** - * Create and send an `Notification`. + * Create and send a `Notification`. * *

Keeps us from having to construct new Notification * instances in our implementation code.

@@ -86,7 +86,7 @@ class Notifier { /** * Return the Multiton Facade instance * - * @typedef {Facade} Facade + * @returns {Facade} * * @throws {Error} */ From 9ccec3d1dc524a30157f131b5ac16ed585d8b9ed Mon Sep 17 00:00:00 2001 From: Saad Date: Sat, 2 Nov 2024 02:44:33 -0400 Subject: [PATCH 3/4] update generated docs --- .github/workflows/node.js.yml | 2 +- docs/Controller.html | 4 +- docs/Facade.html | 6700 +++++++++++++++++++ docs/MacroCommand.html | 4 +- docs/Mediator.html | 18 +- docs/Model.html | 50 +- docs/Notification.html | 30 +- docs/Notifier.html | 70 +- docs/Observer.html | 49 +- docs/Proxy.html | 26 +- docs/SimpleCommand.html | 4 +- docs/View.html | 4 +- docs/core_Controller.js.html | 8 +- docs/core_Model.js.html | 8 +- docs/core_View.js.html | 4 +- docs/index.html | 9 +- docs/patterns_command_MacroCommand.js.html | 4 +- docs/patterns_command_SimpleCommand.js.html | 4 +- docs/patterns_facade_Facade.js.html | 11 +- docs/patterns_mediator_Mediator.js.html | 12 +- docs/patterns_observer_Notification.js.html | 7 +- docs/patterns_observer_Notifier.js.html | 8 +- docs/patterns_observer_Observer.js.html | 14 +- docs/patterns_proxy_Proxy.js.html | 14 +- package-lock.json | 4 +- 25 files changed, 6950 insertions(+), 118 deletions(-) create mode 100644 docs/Facade.html diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 32b1719..0b47e7b 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -2,7 +2,7 @@ name: Node.js CI on: push: - branches: [ "master", "develop" ] + branches: [ "develop" ] pull_request: branches: [ "master" ] diff --git a/docs/Controller.html b/docs/Controller.html index 69aea42..4bf4f3f 100644 --- a/docs/Controller.html +++ b/docs/Controller.html @@ -24,7 +24,7 @@
@@ -3156,7 +3156,7 @@
Parameters:

- Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
diff --git a/docs/Facade.html b/docs/Facade.html new file mode 100644 index 0000000..e3a3dee --- /dev/null +++ b/docs/Facade.html @@ -0,0 +1,6700 @@ + + + + + + Facade - Documentation + + + + + + + + + + + + + + + + + +
+ +

Facade

+ + + + + + + +
+ +
+ +

+ Facade +

+ + +
+ +
+
+ + +
+ + + +

new Facade()

+ + + + + +
+

A base Multiton Facade implementation.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + +
See:
+
+
    +
  • Model Model
  • + +
  • View View
  • + +
  • Controller Controller
  • +
+
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ +
+ + + + + + + + + + + + +

Members

+ + + +
+

(static) instanceMap :Map.<string, Facade>

+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
Type:
+
    +
  • + +Map.<string, Facade> + + +
  • +
+ + + + + +
+ + + +
+

(static) MULTITON_MSG

+ + + + +
+

Message Constants

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
+ + + + + +

Methods

+ + + +
+ + + +

(static) getInstance(key, factory) → {Facade}

+ + + + + +
+

Facade Multiton Factory method

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + + + +
factory + + +function + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Facade + + +
+
+ + +
+

the Multiton instance of the Facade

+
+ + +
+ + + +
+ + +
+ + + +

(static) hasCore(key) → {boolean}

+ + + + + +
+

Check if a Core is registered or not

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + +

the multiton key for the Core in question

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +boolean + + +
+
+ + +
+

whether a Core is registered with the given key.

+
+ + +
+ + + +
+ + +
+ + + +

(static) removeCore(key)

+ + + + + +
+

Remove a Core.

+

Remove the Model, View, Controller and Facade +instances for the given key.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + +

multitonKey of the Core to remove

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

hasCommand(notificationName) → {boolean}

+ + + + + +
+

Check if a Command is registered for a given Notification

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
notificationName + + +string + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +boolean + + +
+
+ + +
+

whether a Command is currently registered for the given notificationName.

+
+ + +
+ + + +
+ + +
+ + + +

hasMediator(mediatorName) → {boolean}

+ + + + + +
+

Check if a Mediator is registered or not

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mediatorName + + +string + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +boolean + + +
+
+ + +
+

whether a Mediator is registered with the given mediatorName.

+
+ + +
+ + + +
+ + +
+ + + +

hasProxy(proxyName) → {boolean}

+ + + + + +
+

Check if a Proxy is registered

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proxyName + + +string + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +boolean + + +
+
+ + +
+

whether a Proxy is currently registered with the given proxyName.

+
+ + +
+ + + +
+ + +
+ + + +

initializeController()

+ + + + + +
+

Initialize the Controller.

+

Called by the `initializeFacade` method. +Override this method in your subclass of `Facade` +if one or both of the following are true:

+
    +
  • You wish to initialize a different `Controller`.
  • +
  • You have `Commands` to register with the `Controller` at startup.`.
  • +
+

If you don't want to initialize a different `Controller`, +call `super.initializeController()` at the beginning of your +method, then register `Command`s.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

initializeFacade()

+ + + + + +
+

Initialize the Multiton Facade instance.

+

Called automatically by the constructor. Override in your +subclass to do any subclass specific initializations. Be +sure to call `super.initializeFacade()`, though.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

initializeModel()

+ + + + + +
+

Initialize the Model.

+

Called by the `initializeFacade` method. +Override this method in your subclass of `Facade` +if one or both of the following are true:

+
    +
  • You wish to initialize a different `Model`.
  • +
  • You have `Proxy`s to register with the Model that do not +retrieve a reference to the Facade at construction time.`
  • +
+

If you don't want to initialize a different Model, +call super.initializeModel() at the beginning of your +method, then register Proxys.

+

Note: This method is rarely overridden; in practice you are more +likely to use a `Command` to create and register `Proxy`s +with the `Model`, since `Proxy`s with mutable data will likely +need to send `Notification`s and thus will likely want to fetch a reference to +the `Facade` during their construction.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

initializeNotifier()

+ + + + + +
+

Set the Multiton key for this facade instance.

+

Not called directly, but instead from the +constructor when getInstance is invoked. +It is necessary to be public in order to +implement Notifier.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

initializeView()

+ + + + + +
+

Initialize the View.

+

Called by the `initializeFacade` method. +Override this method in your subclass of `Facade` +if one or both of the following are true:

+
    +
  • You wish to initialize a different `View`.
  • +
  • You have `Observers` to register with the `View`
  • +
+

If you don't want to initialize a different `View`, +call `super.initializeView()` at the beginning of your +method, then register `Mediator` instances.

+

Note: This method is rarely overridden; in practice you are more +likely to use a `Command` to create and register `Mediator`s +with the `View`, since `Mediator` instances will need to send +`Notification`s and thus will likely want to fetch a reference +to the `Facade` during their construction.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

notifyObservers(notification)

+ + + + + +
+

Notify Observers.

+

This method is left public mostly for backward +compatibility, and to allow you to send custom +notification classes using the facade.

+

Usually you should just call `sendNotification` +and pass the parameters, never having to +construct the notification yourself.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
notification + + +Notification + + + + +

the Notification to have the View notify Observers of.

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

registerCommand(notificationName, factory)

+ + + + + +
+

Register a Command with the Controller by Notification name.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
notificationName + + +string + + + + +

the name of the Notification to associate the Command with

+ +
factory + + +function + + + + +

a reference to the factory of the Command

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

registerMediator(mediator)

+ + + + + +
+

Register a Mediator with the View.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mediator + + +Mediator + + + + +

a reference to the Mediator

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

registerProxy(proxy)

+ + + + + +
+

Register a Proxy with the Model by name.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proxy + + +Proxy + + + + +

the Proxy instance to be registered with the Model.

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

removeCommand(notificationName)

+ + + + + +
+

Remove a previously registered Command to Notification mapping from the Controller.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
notificationName + + +string + + + + +

the name of the Notification to remove the Command mapping for

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

removeMediator(mediatorName) → {Mediator}

+ + + + + +
+

Remove a Mediator from the View.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mediatorName + + +string + + + + +

name of the Mediator to be removed.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Mediator + + +
+
+ + +
+

the Mediator that was removed from the View

+
+ + +
+ + + +
+ + +
+ + + +

removeProxy(proxyName) → {Proxy}

+ + + + + +
+

Remove a Proxy from the Model by name.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proxyName + + +string + + + + +

the Proxy to remove from the Model.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Proxy + + +
+
+ + +
+

the Proxy that was removed from the Model

+
+ + +
+ + + +
+ + +
+ + + +

retrieveMediator(mediatorName) → {Mediator}

+ + + + + +
+

Retrieve a Mediator from the View.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mediatorName + + +string + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Mediator + + +
+
+ + +
+

the Mediator previously registered with the given mediatorName.

+
+ + +
+ + + +
+ + +
+ + + +

retrieveProxy(proxyName) → {Proxy}

+ + + + + +
+

Retrieve a Proxy from the Model by name.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proxyName + + +string + + + + +

the name of the proxy to be retrieved.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Proxy + + +
+
+ + +
+

the Proxy instance previously registered with the given proxyName.

+
+ + +
+ + + +
+ + +
+ + + +

sendNotification(notificationName, bodyopt, typeopt)

+ + + + + +
+

Create and send an Notification.

+

Keeps us from having to construct new notification +instances in our implementation code.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
notificationName + + +string + + + + + + + + + + + + +

the name of the notification to send

+ +
body + + +Object + + + + + + <optional>
+ + + + + +
+ + null + + +

body the body of the notification (optional)

+ +
type + + +string + + + + + + <optional>
+ + + + + +
+ + +

type the type of the notification (optional)

+ +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+ +
+ + + + + + + +
+ +
+ +

+ Facade +

+ + +
+ +
+
+ + +
+ + + +

new Facade(key)

+ + + + + +
+

Constructor.

+

This `Facade` implementation is a Multiton, +so you should not call the constructor +directly, but instead call the static Factory method, +passing the unique key for this instance +`Facade.getInstance( multitonKey )`

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + + + +
+ + + + + + + + + + + + +
+
Throws:
+ + + +
+
+
+

Error if instance for this Multiton key has already been constructed

+
+
+
+
+
+
+ Type +
+
+ +Error + + +
+
+
+
+
+ + + +
+ + + + + +
+ +
+ + + + + + + + + + + + +

Members

+ + + +
+

(static) instanceMap :Map.<string, Facade>

+ + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + +
Type:
+
    +
  • + +Map.<string, Facade> + + +
  • +
+ + + + + +
+ + + +
+

(static) MULTITON_MSG

+ + + + +
+

Message Constants

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + +
+ + + + + +

Methods

+ + + +
+ + + +

(static) getInstance(key, factory) → {Facade}

+ + + + + +
+

Facade Multiton Factory method

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + + + +
factory + + +function + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Facade + + +
+
+ + +
+

the Multiton instance of the Facade

+
+ + +
+ + + +
+ + +
+ + + +

(static) hasCore(key) → {boolean}

+ + + + + +
+

Check if a Core is registered or not

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + +

the multiton key for the Core in question

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +boolean + + +
+
+ + +
+

whether a Core is registered with the given key.

+
+ + +
+ + + +
+ + +
+ + + +

(static) removeCore(key)

+ + + + + +
+

Remove a Core.

+

Remove the Model, View, Controller and Facade +instances for the given key.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
key + + +string + + + + +

multitonKey of the Core to remove

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

hasCommand(notificationName) → {boolean}

+ + + + + +
+

Check if a Command is registered for a given Notification

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
notificationName + + +string + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +boolean + + +
+
+ + +
+

whether a Command is currently registered for the given notificationName.

+
+ + +
+ + + +
+ + +
+ + + +

hasMediator(mediatorName) → {boolean}

+ + + + + +
+

Check if a Mediator is registered or not

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mediatorName + + +string + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +boolean + + +
+
+ + +
+

whether a Mediator is registered with the given mediatorName.

+
+ + +
+ + + +
+ + +
+ + + +

hasProxy(proxyName) → {boolean}

+ + + + + +
+

Check if a Proxy is registered

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proxyName + + +string + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +boolean + + +
+
+ + +
+

whether a Proxy is currently registered with the given proxyName.

+
+ + +
+ + + +
+ + +
+ + + +

initializeController()

+ + + + + +
+

Initialize the Controller.

+

Called by the `initializeFacade` method. +Override this method in your subclass of `Facade` +if one or both of the following are true:

+
    +
  • You wish to initialize a different `Controller`.
  • +
  • You have `Commands` to register with the `Controller` at startup.`.
  • +
+

If you don't want to initialize a different `Controller`, +call `super.initializeController()` at the beginning of your +method, then register `Command`s.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

initializeFacade()

+ + + + + +
+

Initialize the Multiton Facade instance.

+

Called automatically by the constructor. Override in your +subclass to do any subclass specific initializations. Be +sure to call `super.initializeFacade()`, though.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

initializeModel()

+ + + + + +
+

Initialize the Model.

+

Called by the `initializeFacade` method. +Override this method in your subclass of `Facade` +if one or both of the following are true:

+
    +
  • You wish to initialize a different `Model`.
  • +
  • You have `Proxy`s to register with the Model that do not +retrieve a reference to the Facade at construction time.`
  • +
+

If you don't want to initialize a different Model, +call super.initializeModel() at the beginning of your +method, then register Proxys.

+

Note: This method is rarely overridden; in practice you are more +likely to use a `Command` to create and register `Proxy`s +with the `Model`, since `Proxy`s with mutable data will likely +need to send `Notification`s and thus will likely want to fetch a reference to +the `Facade` during their construction.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

initializeNotifier()

+ + + + + +
+

Set the Multiton key for this facade instance.

+

Not called directly, but instead from the +constructor when getInstance is invoked. +It is necessary to be public in order to +implement Notifier.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

initializeView()

+ + + + + +
+

Initialize the View.

+

Called by the `initializeFacade` method. +Override this method in your subclass of `Facade` +if one or both of the following are true:

+
    +
  • You wish to initialize a different `View`.
  • +
  • You have `Observers` to register with the `View`
  • +
+

If you don't want to initialize a different `View`, +call `super.initializeView()` at the beginning of your +method, then register `Mediator` instances.

+

Note: This method is rarely overridden; in practice you are more +likely to use a `Command` to create and register `Mediator`s +with the `View`, since `Mediator` instances will need to send +`Notification`s and thus will likely want to fetch a reference +to the `Facade` during their construction.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + +

notifyObservers(notification)

+ + + + + +
+

Notify Observers.

+

This method is left public mostly for backward +compatibility, and to allow you to send custom +notification classes using the facade.

+

Usually you should just call `sendNotification` +and pass the parameters, never having to +construct the notification yourself.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
notification + + +Notification + + + + +

the Notification to have the View notify Observers of.

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

registerCommand(notificationName, factory)

+ + + + + +
+

Register a Command with the Controller by Notification name.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
notificationName + + +string + + + + +

the name of the Notification to associate the Command with

+ +
factory + + +function + + + + +

a reference to the factory of the Command

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

registerMediator(mediator)

+ + + + + +
+

Register a Mediator with the View.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mediator + + +Mediator + + + + +

a reference to the Mediator

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

registerProxy(proxy)

+ + + + + +
+

Register a Proxy with the Model by name.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proxy + + +Proxy + + + + +

the Proxy instance to be registered with the Model.

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

removeCommand(notificationName)

+ + + + + +
+

Remove a previously registered Command to Notification mapping from the Controller.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
notificationName + + +string + + + + +

the name of the Notification to remove the Command mapping for

+ +
+ + + + + + + + + + + + + + + + +
+ + +
+ + + +

removeMediator(mediatorName) → {Mediator}

+ + + + + +
+

Remove a Mediator from the View.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mediatorName + + +string + + + + +

name of the Mediator to be removed.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Mediator + + +
+
+ + +
+

the Mediator that was removed from the View

+
+ + +
+ + + +
+ + +
+ + + +

removeProxy(proxyName) → {Proxy}

+ + + + + +
+

Remove a Proxy from the Model by name.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proxyName + + +string + + + + +

the Proxy to remove from the Model.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Proxy + + +
+
+ + +
+

the Proxy that was removed from the Model

+
+ + +
+ + + +
+ + +
+ + + +

retrieveMediator(mediatorName) → {Mediator}

+ + + + + +
+

Retrieve a Mediator from the View.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
mediatorName + + +string + + + + + + +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Mediator + + +
+
+ + +
+

the Mediator previously registered with the given mediatorName.

+
+ + +
+ + + +
+ + +
+ + + +

retrieveProxy(proxyName) → {Proxy}

+ + + + + +
+

Retrieve a Proxy from the Model by name.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeDescription
proxyName + + +string + + + + +

the name of the proxy to be retrieved.

+ +
+ + + + + + + + + + + + + + +
+
Returns:
+ + + +
+
+ Type: +
+
+ +Proxy + + +
+
+ + +
+

the Proxy instance previously registered with the given proxyName.

+
+ + +
+ + + +
+ + +
+ + + +

sendNotification(notificationName, bodyopt, typeopt)

+ + + + + +
+

Create and send an Notification.

+

Keeps us from having to construct new notification +instances in our implementation code.

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + + + + +
Parameters:
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
NameTypeAttributesDefaultDescription
notificationName + + +string + + + + + + + + + + + + +

the name of the notification to send

+ +
body + + +Object + + + + + + <optional>
+ + + + + +
+ + null + + +

body the body of the notification (optional)

+ +
type + + +string + + + + + + <optional>
+ + + + + +
+ + +

type the type of the notification (optional)

+ +
+ + + + + + + + + + + + + + + + +
+ + + + + + +
+ +
+ + + + +
+ +
+ +
+ Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme. +
+ + + + + \ No newline at end of file diff --git a/docs/MacroCommand.html b/docs/MacroCommand.html index 485d554..45356b7 100644 --- a/docs/MacroCommand.html +++ b/docs/MacroCommand.html @@ -24,7 +24,7 @@
@@ -1217,7 +1217,7 @@

- Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
diff --git a/docs/Mediator.html b/docs/Mediator.html index 0b3fcb7..df89006 100644 --- a/docs/Mediator.html +++ b/docs/Mediator.html @@ -24,7 +24,7 @@
@@ -870,7 +870,7 @@

-

new Mediator(mediatorName, viewComponentopt)

+

new Mediator(mediatorNameopt, viewComponentopt)

@@ -968,6 +968,9 @@
Parameters:
string +| + +null @@ -976,6 +979,8 @@
Parameters:
+ <optional>
+ @@ -986,6 +991,8 @@
Parameters:
+ null + @@ -1006,6 +1013,9 @@
Parameters:
Object +| + +null @@ -1032,7 +1042,7 @@
Parameters:
-

viewComponent

+ @@ -1770,7 +1780,7 @@

onRemove
- Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
diff --git a/docs/Model.html b/docs/Model.html index 70a2cbf..fa211f1 100644 --- a/docs/Model.html +++ b/docs/Model.html @@ -24,7 +24,7 @@
@@ -210,7 +210,7 @@

(static)
Source:
@@ -280,7 +280,7 @@

(static) Source:
@@ -350,7 +350,7 @@

(protected) Source:
@@ -420,7 +420,7 @@

(protected) p
Source:
@@ -504,7 +504,7 @@

(static)
Source:
@@ -690,7 +690,7 @@

(static)
Source:
@@ -820,7 +820,7 @@

hasProxySource:
@@ -984,7 +984,7 @@

initia
Source:
@@ -1067,7 +1067,7 @@

register
Source:
@@ -1202,7 +1202,7 @@

removeProx
Source:
@@ -1362,7 +1362,7 @@

retrieve
Source:
@@ -1555,7 +1555,7 @@

new ModelSource:
@@ -1730,7 +1730,7 @@

(static)
Source:
@@ -1800,7 +1800,7 @@

(static) Source:
@@ -1870,7 +1870,7 @@

(protected) Source:
@@ -1940,7 +1940,7 @@

(protected) p
Source:
@@ -2024,7 +2024,7 @@

(static)
Source:
@@ -2210,7 +2210,7 @@

(static)
Source:
@@ -2340,7 +2340,7 @@

hasProxySource:
@@ -2504,7 +2504,7 @@

initia
Source:
@@ -2587,7 +2587,7 @@

register
Source:
@@ -2722,7 +2722,7 @@

removeProx
Source:
@@ -2882,7 +2882,7 @@

retrieve
Source:
@@ -3011,7 +3011,7 @@

Returns:

- Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
diff --git a/docs/Notification.html b/docs/Notification.html index bf3dc3c..93d9e73 100644 --- a/docs/Notification.html +++ b/docs/Notification.html @@ -24,7 +24,7 @@
@@ -215,7 +215,7 @@

bodySource:
@@ -279,7 +279,7 @@

bodySource:
@@ -343,7 +343,7 @@

nameSource:
@@ -407,7 +407,7 @@

typeSource:
@@ -471,7 +471,7 @@

typeSource:
@@ -545,7 +545,7 @@

toStringSource:
@@ -678,7 +678,7 @@

new Notif
Source:
@@ -928,7 +928,7 @@

bodySource:
@@ -992,7 +992,7 @@

bodySource:
@@ -1056,7 +1056,7 @@

nameSource:
@@ -1120,7 +1120,7 @@

typeSource:
@@ -1184,7 +1184,7 @@

typeSource:
@@ -1258,7 +1258,7 @@

toStringSource:
@@ -1331,7 +1331,7 @@
Returns:

- Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
diff --git a/docs/Notifier.html b/docs/Notifier.html index 15a73f3..b713367 100644 --- a/docs/Notifier.html +++ b/docs/Notifier.html @@ -24,7 +24,7 @@
@@ -246,6 +246,70 @@

(static) + + + +
+

facade

+ + + + +
+

Return the Multiton Facade instance

+
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
Source:
+
+ + + + + + + +
+ + + + + + +
@@ -412,7 +476,7 @@

sendN
-

Create and send an Notification.

+

Create and send a Notification.

Keeps us from having to construct new Notification instances in our implementation code.

@@ -652,7 +716,7 @@

Parameters:

- Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
diff --git a/docs/Observer.html b/docs/Observer.html index a325310..d7c706a 100644 --- a/docs/Observer.html +++ b/docs/Observer.html @@ -24,7 +24,7 @@
@@ -748,7 +748,7 @@

-

new Observer(notifyMethod, notifyContext)

+

new Observer(notifyopt, contextopt)

@@ -825,8 +825,12 @@
Parameters:
Type + Attributes + + Default + Description @@ -837,7 +841,7 @@
Parameters:
- notifyMethod + notify @@ -850,8 +854,24 @@
Parameters:
+ + + <optional>
+ + + + + + + + + + null + + + @@ -863,21 +883,40 @@
Parameters:
- notifyContext + context Object +| + +null + + + <optional>
+ + + + + + + + + + null + + + @@ -1493,7 +1532,7 @@
Parameters:

- Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
diff --git a/docs/Proxy.html b/docs/Proxy.html index 614bc6f..2b8a042 100644 --- a/docs/Proxy.html +++ b/docs/Proxy.html @@ -24,7 +24,7 @@
@@ -229,7 +229,7 @@

(static) NAME -

(protected) _data :Object

+

(protected) _data :Object|null

@@ -285,6 +285,9 @@
Type:
  • Object +| + +null
  • @@ -765,7 +768,7 @@

    -

    new Proxy(proxyName, dataopt)

    +

    new Proxy(proxyNameopt, dataopt)

    @@ -863,6 +866,9 @@
    Parameters:
    string +| + +null @@ -871,6 +877,8 @@
    Parameters:
    + <optional>
    + @@ -881,6 +889,8 @@
    Parameters:
    + null + @@ -901,6 +911,9 @@
    Parameters:
    Object +| + +null @@ -1031,7 +1044,7 @@

    (static) NAME -

    (protected) _data :Object

    +

    (protected) _data :Object|null

    @@ -1087,6 +1100,9 @@
    Type:
  • Object +| + +null
  • @@ -1550,7 +1566,7 @@

    onRemove
    - Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
    diff --git a/docs/SimpleCommand.html b/docs/SimpleCommand.html index 901fcf7..72b785e 100644 --- a/docs/SimpleCommand.html +++ b/docs/SimpleCommand.html @@ -24,7 +24,7 @@
    @@ -321,7 +321,7 @@
    Parameters:

    - Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
    diff --git a/docs/View.html b/docs/View.html index c5538fa..bd54345 100644 --- a/docs/View.html +++ b/docs/View.html @@ -24,7 +24,7 @@
    @@ -4098,7 +4098,7 @@
    Returns:

    - Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
    diff --git a/docs/core_Controller.js.html b/docs/core_Controller.js.html index 9275a85..d6a384a 100644 --- a/docs/core_Controller.js.html +++ b/docs/core_Controller.js.html @@ -24,7 +24,7 @@
    @@ -95,10 +95,10 @@

    core/Controller.js

    * passing the unique key for this instance * `Controller.getInstance( multitonKey )`</P> * - * @throws {Error} Error if instance for this Multiton key has already been constructed - * * @constructor * @param {string} key + * + * @throws {Error} Error if instance for this Multiton key has already been constructed */ constructor(key) { if (Controller.instanceMap[key] != null) throw new Error(Controller.MULTITON_MSG); @@ -247,7 +247,7 @@

    core/Controller.js


    - Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
    diff --git a/docs/core_Model.js.html b/docs/core_Model.js.html index 4a6c89e..dfd3b16 100644 --- a/docs/core_Model.js.html +++ b/docs/core_Model.js.html @@ -24,7 +24,7 @@
    @@ -71,7 +71,6 @@

    core/Model.js

    * * @class Model */ - class Model { /** @@ -191,7 +190,8 @@

    core/Model.js

    */ static get MULTITON_MSG() { return "Model instance for this Multiton key already constructed!" }; } -export { Model } +export { Model } + @@ -203,7 +203,7 @@

    core/Model.js


    - Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
    diff --git a/docs/core_View.js.html b/docs/core_View.js.html index 3cd838f..9a91eba 100644 --- a/docs/core_View.js.html +++ b/docs/core_View.js.html @@ -24,7 +24,7 @@
    @@ -317,7 +317,7 @@

    core/View.js


    - Generated by JSDoc 3.6.5 on Tue Aug 13 2024 11:50:50 GMT-0400 (Eastern Daylight Time) using the Minami theme. + Generated by JSDoc 3.6.11 on Tue Oct 29 2024 20:35:08 GMT-0400 (Eastern Daylight Time) using the Minami theme.
    diff --git a/docs/index.html b/docs/index.html index b1d5051..421f7c0 100644 --- a/docs/index.html +++ b/docs/index.html @@ -24,7 +24,7 @@
    @@ -55,6 +55,9 @@
  • API Docs
  • Legacy Implementation
  • +

    Installation

    +
    npm i @puremvc/puremvc-js-multicore-framework
    +

    Demos

    Status

    -

    Production - Version 2.0.4

    +

    Production - Version 2.0.9

    Documentation