From b36f9dfeef47db517b2105efcfdfcb7f825e910a Mon Sep 17 00:00:00 2001 From: Radek Stepan Date: Wed, 1 Oct 2014 20:36:10 -0700 Subject: [PATCH] system model --- src/models/system.coffee | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/models/system.coffee 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