Permalink
Browse files

Added dynamic modules

  • Loading branch information...
1 parent 0585333 commit 6b05dba006552e6144d42cf9e3b5fe85b06ad2c5 @andersjanmyr committed Nov 11, 2011
Showing with 18 additions and 0 deletions.
  1. +18 −0 higher_order_functions/03_structuring.md
@@ -159,6 +159,24 @@ say.call(frog, 'Hi');
result = [app.next(), app.next(),
app.reset()]
+!SLIDE small
+# Module with parameters
+
+ @@@javaScript
+ var app = (function(m1, m2) {
+
+ return {
+ doSomething: function() {
+ return m1.doNext();
+ },
+
+ doSomethingElse: function() {
+ return m2.doSomething();
+ }
+ };
+ })(module1, otherModule);
+
+
!SLIDE small execute
# Class Function

0 comments on commit 6b05dba

Please sign in to comment.