Greg Hinch![]()
This simple DataSource plugin can be configured to "cancelStaleRequests" and/or "ignoreStaleResponses". Setting these to true will do just what it sounds like, the former will cancel any in progress request when a new one is made to the plugged DataSource, while the latter will not fire the response event for any but the most recent request made. While this works with most DataSources, it really only would be useful with DataSource.IO. ***NOTE: At this time this plugin is INCOMPATIBLE with DataSource.Get, as there is a partial implementation of this functionality already in that specific one only.***
Used like any other plugin, simply add it to your DataSource
<script src="http://yui.yahooapis.com/3.2.0/build/yui/yui-min.js"></script>YUI({
//Last Gallery Build of this module
gallery: 'gallery-2010.11.03-19-46'
}).use('gallery-datasource-manage-stale', 'datasource-io', function(Y) {
var mySource = new Y.DataSource.IO({
source : '/some/location?',
plugins : [
{fn : Y.Plugin.DataSourceManageStale, cfg : {
cancelStaleRequests : true,
ignoreStaleResponses : true
}}
]
});
});No forum posts for this module.
© 2006-2013 Yahoo! Inc. All rights reserved.
All code on this site is licensed under the BSD License unless stated otherwise.
About This Site · Security Contact Info