Self-Executing Anonymous Function with Revealing Module Pattern - in typescript

442 Views Asked by At

On the basis of this js example, what would be the preferred way to do the same in ts the ts way - I have been experimenting with classes, modules and namespaces but still unsure and still not getting a match so would like to see your ideas;

(function($, window, document, undefined) {
  'use strict';

  var MyProject = MyProject = MyProject || {};
  var MyArea = MyProject.MyArea = MyProject.MyArea || {}; 

  MyArea.MyModule = (function() {
    var PublicFunction = function() { };

    var PrivateFunction = function() { };

    return {
      PublicFunction: PublicFunction
    };
  })();
})(jQuery, window, document);

The idea behind it is creating a Self-Executing Anonymous Function, using Revealing Module Pattern and placing all my modules in a single namespace defined by myself.

0

There are 0 best solutions below