forked from nosovsh/motoparking
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fluxy.js
61 lines (46 loc) · 1.72 KB
/
fluxy.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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
var _ = require("lodash");
var Fluxxor = require("fluxxor");
var ParkingStore = require("./flux/parking/ParkingStore");
var ParkingActions = require("./flux/parking/ParkingActions");
var OpinionStore = require("./flux/opinion/OpinionStore");
var OpinionActions = require("./flux/opinion/OpinionActions");
var CurrentUserStore = require("./flux/currentUser/CurrentUserStore");
var CurrentUserActions = require("./flux/currentUser/CurrentUserActions");
var CommentStore = require("./flux/comment/CommentStore");
var CommentActions = require("./flux/comment/CommentActions");
var ParkingImageStore = require("./flux/parkingImage/ParkingImageStore");
var ParkingImageActions = require("./flux/parkingImage/ParkingImageActions");
var AppStore = require("./flux/app/AppStore");
var AppActions = require("./flux/app/AppActions");
var ToastStore = require("./flux/toast/ToastStore");
var ToastActions = require("./flux/toast/ToastActions");
var UserStore = require("./flux/user/UserStore");
var UserActions = require("./flux/user/UserActions");
var stores = {
ParkingStore: new ParkingStore(),
OpinionStore: new OpinionStore(),
CurrentUserStore: new CurrentUserStore(),
CommentStore: new CommentStore(),
ParkingImageStore: new ParkingImageStore(),
AppStore: new AppStore(),
ToastStore: new ToastStore(),
UserStore: new UserStore()
};
var actions = _.extend(
ParkingActions,
OpinionActions,
CurrentUserActions,
CommentActions,
ParkingImageActions,
AppActions,
ToastActions,
UserActions
);
var flux = new Fluxxor.Flux(stores, actions);
window.flux = flux;
flux.on("dispatch", function(type, payload) {
if (console && console.log) {
console.log("[Dispatch]", type, payload);
}
});
module.exports = flux;