-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathapp.js
34 lines (28 loc) · 943 Bytes
/
app.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import Fluxible from 'fluxible';
import Application from './components/Application';
import ApplicationStore from './stores/ApplicationStore';
import RouteStore from './stores/RouteStore';
import SearchStore from './stores/SearchStore';
import fetchrPlugin from 'fluxible-plugin-fetchr';
// create new fluxible instance
const app = new Fluxible({
component: Application,
componentActionHandler: function (context, payload, done) {
if (payload.err) {
if (payload.err.statusCode === 404) {
console.log('component 404 error', payload.err);
}
else {
console.log('component exception', payload.err);
}
return;
}
done();
}
});
app.plug(fetchrPlugin({ xhrPath: '/_api' }));
// register stores
app.registerStore(RouteStore);
app.registerStore(ApplicationStore);
app.registerStore(SearchStore);
module.exports = app;