-
-
Save rogaldh/a52e231b7e65de22bfc4 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
/* | |
* React.js Starter Kit | |
* Copyright (c) 2014 Konstantin Tarkus (@koistya), KriaSoft LLC. | |
*/ | |
'use strict'; | |
var Dispatcher = require('../core/Dispatcher'); | |
var ActionTypes = require('../constants/ActionTypes'); | |
var SourceTypes = require('../constants/SourceTypes') | |
var http = require('superagent'); | |
module.exports = { | |
loadPage(path) { | |
Dispatcher.handleViewAction({ | |
actionType: ActionTypes.LOAD_PAGE, path: path | |
}); | |
http.get('/api/page' + path) | |
.accept('application/json') | |
.end((err, res) => { | |
Dispatcher.handleServerAction({ | |
actionType: ActionTypes.LOAD_PAGE, path: path, err: err, page: res | |
}); | |
}); | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment