Guest User

Untitled

a guest
Aug 17th, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. My own mini-framework is not compatible with some projects
  2. var MyLibrary = {
  3.  
  4. myFunc: function() { /* stuff */ }
  5.  
  6. };
  7.  
  8. var MyLibrary = (function() {
  9.  
  10. var foo = 'bar';
  11.  
  12. return {
  13. myFunc: function() { /* stuff */ }
  14. };
  15.  
  16. })(); // execute this function right away to return your library object
  17.  
  18. var MyLibrary = {
  19. myFunc: function() {
  20. //do stuff
  21. },
  22.  
  23. myVar: "Foo"
  24. }
  25.  
  26. AzureLib = {
  27. SortSomething: function(arr) {
  28. // do some sorting
  29. },
  30. DoSomethingCool: function(item) {
  31. // do something cool
  32. }
  33. };
  34.  
  35. // usage (in another JavaScript file or in an HTML <script> tag):
  36. AzureLib.SortSomething(myArray);
  37.  
  38. var yourLib = {};
  39.  
  40. yourLib.usefulFunction1 = function(){
  41. ..
  42. };
  43.  
  44. yourLib.usefulFunction2 = function(){
  45. ..
  46. };
Add Comment
Please, Sign In to add comment