Total Complexity | 1 |
Complexity/F | 1 |
Lines of Code | 22 |
Function Count | 1 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 20% |
Changes | 5 | ||
Bugs | 1 | Features | 4 |
1 | import App from "app"; |
||
2 | |||
3 | // application's services |
||
4 | import Request from "./ajax/Request"; |
||
5 | 4 | import PersistentCache from "./cache/Persistent"; |
|
6 | |||
7 | // example: |
||
8 | // constructor |
||
9 | // App.ServicesContainer.define("Service", require("./Service")) |
||
10 | |||
11 | // instance |
||
12 | // App.ServicesContainer.setInstance("Service", new Service()); |
||
13 | |||
14 | |||
15 | // Default services |
||
16 | // interface to handle AJAX requests |
||
17 | App.ServicesContainer.define("AJAX", Request); |
||
18 | App.ServicesContainer.define("Cache", PersistentCache); |
||
19 | |||
20 | // configure AJAX to always ask for json |
||
21 | // You can ask for a new instance do get rid of this behaviour :) |
||
22 | App.ServicesContainer.get("AJAX").onStart(req => req.set("Accept", "application/json")); |
||
23 |