« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/data/composite/wiki-properties/wikiData.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/data/composite/wiki-properties/wikiData.js')
-rw-r--r--src/data/composite/wiki-properties/wikiData.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/data/composite/wiki-properties/wikiData.js b/src/data/composite/wiki-properties/wikiData.js
new file mode 100644
index 00000000..4ea47785
--- /dev/null
+++ b/src/data/composite/wiki-properties/wikiData.js
@@ -0,0 +1,17 @@
+// General purpose wiki data constructor, for properties like artistData,
+// trackData, etc.
+
+import {validateArrayItems, validateInstanceOf} from '#validators';
+
+// TODO: Not templateCompositeFrom.
+
+// TODO: This should validate with validateWikiData.
+
+export default function(thingClass) {
+  return {
+    flags: {update: true},
+    update: {
+      validate: validateArrayItems(validateInstanceOf(thingClass)),
+    },
+  };
+}