diff --git a/src/models/system.coffee b/src/models/system.coffee new file mode 100644 index 0000000..73bd7c0 --- /dev/null +++ b/src/models/system.coffee @@ -0,0 +1,17 @@ +mediator = require '../modules/mediator' +Model = require '../utils/model' + +# System state. +system = new Model + 'data': + 'loading': no + +counter = 0 +async = -> + counter += 1 + system.set 'loading', yes + -> + counter -= 1 + system.set 'loading', +counter + +module.exports = { system, async } \ No newline at end of file