modularize more
[mTask.git] / Utils / SDS.icl
diff --git a/Utils/SDS.icl b/Utils/SDS.icl
new file mode 100644 (file)
index 0000000..f1184a8
--- /dev/null
@@ -0,0 +1,24 @@
+implementation module Utils.SDS
+
+import iTasks
+import iTasks._Framework.Store
+import Devices.mTaskDevice
+import Shares.mTaskShare
+from Data.Func import $
+
+derive class iTask MTaskShare, BCState
+
+memoryShare :: String a -> Shared a | iTask a
+memoryShare s d = sdsFocus s $ memoryStore "" $ Just d
+
+deviceStore :: Shared [MTaskDevice]
+deviceStore = sharedStore "mTaskDevices" []
+
+sdsStore :: Shared [MTaskShare]
+sdsStore = memoryShare "mTaskShares" []
+
+bcStateStore :: Shared BCState
+bcStateStore = memoryShare "mTaskBCState" zero
+
+mTaskTaskStore :: Shared [String]
+mTaskTaskStore = memoryShare "mTaskTasks" ["count", "ledon", "ledoff"]