diff --git a/packages/gallery/package.json b/packages/gallery/package.json index 0c361e1..d5246e0 100644 --- a/packages/gallery/package.json +++ b/packages/gallery/package.json @@ -16,7 +16,7 @@ "domvm": "~3.2.1", "exif-parser": "~0.1.9", "extract-text-webpack-plugin": "^3.0.2", - "frptools": "1.2.0", + "frptools": "2.0.0", "pica": "~2.0.8", "pouchdb-adapter-http": "~6.3.4", "pouchdb-adapter-idb": "~6.3.4", diff --git a/packages/gallery/src/interface/image.js b/packages/gallery/src/interface/image.js index 8f8795c..4b39d2d 100644 --- a/packages/gallery/src/interface/image.js +++ b/packages/gallery/src/interface/image.js @@ -1,11 +1,11 @@ import { defineView, defineElement as el } from 'domvm'; -import { observable, computed } from 'frptools'; +import { prop, computed } from 'frptools'; import * as image from '../data/image.js'; export function ImageView(vm, model) { const { addTag } = model; - const imageData = observable(null); + const imageData = prop(null); let imageId = null; function onAddTag(image_id) { diff --git a/packages/gallery/src/utils/comparators.js b/packages/gallery/src/utils/comparators.js index ecbb658..36e73ac 100644 --- a/packages/gallery/src/utils/comparators.js +++ b/packages/gallery/src/utils/comparators.js @@ -2,7 +2,7 @@ import { extractID } from './conversion.js'; import { equals } from './set.js'; export function pouchDocArrayComparator(a, b) { - if (!Array.isArray(b)) { + if (!Array.isArray(a)) { return false; } const aIDs = a.map(extractID); diff --git a/packages/gallery/src/utils/livearray.js b/packages/gallery/src/utils/livearray.js index daffbef..3e09d81 100644 --- a/packages/gallery/src/utils/livearray.js +++ b/packages/gallery/src/utils/livearray.js @@ -1,4 +1,4 @@ -import { observable, computed } from 'frptools'; +import { prop, computed } from 'frptools'; import { matchesSelector } from 'pouchdb-selector-core'; import { getDatabase } from '../services/db.js'; @@ -54,8 +54,8 @@ export function LiveArray(db, selector, watcher) { const _watcher = watcher || Watcher(db, selector); let changeSub = null; - const ready = observable(false); - const data = observable({ docs: [] }); + const ready = prop(false); + const data = prop({ docs: [] }); const docs = computed(r => r.docs, [data], pouchDocArrayComparator); const idSet = () => docs().reduce((acc, d) => acc.add(d._id), new Set());