mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-19 00:23:25 +02:00
APPSTATE refactoring:
- Make index.html cacheable by being stateless - Improve compression (base64 doesn't gzip well) - Remove base64 encoding/decoding step - Make AppState injectable so it can be unit tested - Ready to remove the global leakage
This commit is contained in:
24
res/app/components/stf/app-state/app-state-provider.js
Normal file
24
res/app/components/stf/app-state/app-state-provider.js
Normal file
@@ -0,0 +1,24 @@
|
||||
module.exports = function AppStateProvider() {
|
||||
var values = {
|
||||
config: {
|
||||
websocketUrl: ''
|
||||
},
|
||||
user: {
|
||||
settings: {}
|
||||
}
|
||||
}
|
||||
|
||||
/*globals GLOBAL_APPSTATE:false*/
|
||||
if (GLOBAL_APPSTATE) {
|
||||
values = angular.extend(values, GLOBAL_APPSTATE)
|
||||
}
|
||||
|
||||
return {
|
||||
set: function (constants) {
|
||||
angular.extend(values, constants)
|
||||
},
|
||||
$get: function () {
|
||||
return values
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user