This file contains hidden or 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 proxy = { | |
_data: {}, | |
get: function (name) { | |
var model = this._data; | |
return model.isYUIModel ? | |
model.apply(model, arguments) : | |
model[name]; | |
}, | |
set: function () { |
This file contains hidden or 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
<!doctype html> | |
<html> | |
<head> | |
<title>IO with transports and promises</title> | |
</head> | |
<body> | |
<script src="http://yui.yahooapis.com/3.9.1/build/yui/yui.js"></script> | |
<script> | |
// sm-io is an alias for sm-io-core and sm-io-xhr. The two modules don't require one another. | |
YUI({ filter: 'raw' }).use('sm-io', function (Y) { |
This file contains hidden or 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
/*global SM:true*/ | |
'use strict'; | |
// Publish a very special, promise-compatible event that supports the default | |
// function behavior to chain on internally created promises before executing | |
// the after() subs. on() subs can still e.preventDefault(), which will | |
// reject the promise and thus skip the default behavior and after() subs. | |
var asyncEvent = eventTarget.publish('foo'); | |
asyncEvent._firing = new Y.Promise(function (resolve) { resolve(); }); |
OlderNewer