Last active
August 29, 2015 14:19
-
-
Save craigtaub/4a130cf77df4abc8f6de to your computer and use it in GitHub Desktop.
fetcher.js
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
| define('fetcher', [ | |
| 'rear', | |
| 'fak', | |
| 'fail' | |
| ], function (real, fake, fail) { | |
| return { | |
| fetch: function (uriStuff) { | |
| getAdapter(uriStuff).fetch().done() { | |
| // some other stuff | |
| }); | |
| }, | |
| getAdapter: function (uriStuff) { | |
| if (fake.shouldFake(uriStuff)) { | |
| return fake; | |
| } | |
| if (fail.shouldFail(uriStuff)) { | |
| return fail; | |
| } | |
| return real; | |
| } | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment