Last active
May 5, 2017 17:17
-
-
Save davidgilbertson/3ae5b5a77d3d5c1d7513f5f39de487ad to your computer and use it in GitHub Desktop.
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
fetch(`/api/search?${queryParams}`) | |
.then(response => response.json()) | |
.then(normalizeSearchResultsApiData) // the do-it-all data massager | |
.then(normalData => { | |
// dispatch normalData to the store here | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Just finished your article (good writeup btw). Why not use Backbone?
parse
andfetch
make this much cleaner: