This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = function() { | |
var browser = require("rest/browser"); | |
var mime = require("rest/interceptor/mime"); | |
var client = browser.wrap(mime, { mime: "application/json" }); | |
return client; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require("lodash"); | |
module.exports = _.extend({ | |
$plugins: [ | |
require("wire/aop") | |
]}, | |
require("../resource/wire-spec"), { | |
bookListViewModel: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require("lodash"); | |
module.exports = _.extend({ | |
$plugins: [ | |
require("wire/aop"), | |
require("msgs/wire"), | |
require("rest/wire")/*, | |
require("wire/debug")*/ | |
]}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "rave-wire-example", | |
"version": "0.0.0", | |
"description": "wire example", | |
"main": "app/run.js", | |
"authors": [ | |
"foxdonut <[email protected]>" | |
], | |
"moduleType": [ | |
"amd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define({ | |
$plugins: [ | |
{ module: "wire/dom" }, | |
{ module: "wire/on" } | |
], | |
model: { module: "app/model" }, | |
getMenuOptions: { module: "app/get-menu-options" }, | |
mealSelect: { $ref: "dom!meal-select" }, | |
menuSelect: { $ref: "dom!menu-select" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define({ | |
$plugins: [ | |
{ module: "wire/dom" }, | |
{ module: "wire/on" } | |
], | |
model: { module: "app/model" }, | |
getMenuOptions: { module: "app/get-menu-options" }, | |
mealSelect: { $ref: "dom!meal-select" }, | |
menuSelect: { $ref: "dom!menu-select" }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns sample (:require [clojure.data.xml :as data.xml] [clojure.java.io :as io])) | |
(defn get-contact-info | |
"Extract info from tag" | |
[content tag] | |
(-> (filter #(= tag (:tag %)) content) first :content first)) | |
(defn process-contact | |
"I don't do a whole lot." | |
[contact] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
can.Model({ | |
findAll: function(params) { | |
var dfd = new can.Deferred(); | |
$.get("/abc", params, function(response) { | |
dfd.resolve(response.model); | |
}); | |
return dfd.promise(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function(chain) { | |
return function(req) { | |
doSomethingBefore(req); | |
chain(req); | |
doSomethingAfter(req); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(fn [chain] | |
(fn [req] | |
(do-something-before req) | |
(chain req) ; continue the chain -- you could potentially not call this to interrupt the chain | |
(do-something-after req))) |
NewerOlder