Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 26th, 2012  |  syntax: None  |  size: 0.76 KB  |  hits: 11  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // Repository Module
  2. var repositoryModule = (function(postal, amplify) {
  3.     var prodListResponse = {
  4.         items: [
  5.             { description: "Product 1", id:"prod1",  price: 30.00 },
  6.             { description: "Product 2", id:"prod2",  price: 11.00 },
  7.             { description: "Product 3", id:"prod3",  price: 19.00 },
  8.             { description: "Product 4", id:"prod4",  price: 23.00 }
  9.         ]
  10.     };
  11.  
  12.     amplify.request.define("get.productlist", function(settings){
  13.         settings.success(prodListResponse);
  14.     });
  15.  
  16.     postal.subscribe("repository", "get.productlist", function() {
  17.         amplify.request("get.productlist", function(response) {
  18.             postal.publish("repository", "response.productlist", response);
  19.         });
  20.     });
  21. })(postal, amplify);