Rename observable to prop(erty) to distinguish from TC39

This commit is contained in:
Timothy Farrell 2017-11-09 16:59:45 -06:00
parent acc0cfb29e
commit 32813ec80b
4 changed files with 7 additions and 7 deletions

View File

@ -16,7 +16,7 @@
"domvm": "~3.2.1", "domvm": "~3.2.1",
"exif-parser": "~0.1.9", "exif-parser": "~0.1.9",
"extract-text-webpack-plugin": "^3.0.2", "extract-text-webpack-plugin": "^3.0.2",
"frptools": "1.2.0", "frptools": "2.0.0",
"pica": "~2.0.8", "pica": "~2.0.8",
"pouchdb-adapter-http": "~6.3.4", "pouchdb-adapter-http": "~6.3.4",
"pouchdb-adapter-idb": "~6.3.4", "pouchdb-adapter-idb": "~6.3.4",

View File

@ -1,11 +1,11 @@
import { defineView, defineElement as el } from 'domvm'; import { defineView, defineElement as el } from 'domvm';
import { observable, computed } from 'frptools'; import { prop, computed } from 'frptools';
import * as image from '../data/image.js'; import * as image from '../data/image.js';
export function ImageView(vm, model) { export function ImageView(vm, model) {
const { addTag } = model; const { addTag } = model;
const imageData = observable(null); const imageData = prop(null);
let imageId = null; let imageId = null;
function onAddTag(image_id) { function onAddTag(image_id) {

View File

@ -2,7 +2,7 @@ import { extractID } from './conversion.js';
import { equals } from './set.js'; import { equals } from './set.js';
export function pouchDocArrayComparator(a, b) { export function pouchDocArrayComparator(a, b) {
if (!Array.isArray(b)) { if (!Array.isArray(a)) {
return false; return false;
} }
const aIDs = a.map(extractID); const aIDs = a.map(extractID);

View File

@ -1,4 +1,4 @@
import { observable, computed } from 'frptools'; import { prop, computed } from 'frptools';
import { matchesSelector } from 'pouchdb-selector-core'; import { matchesSelector } from 'pouchdb-selector-core';
import { getDatabase } from '../services/db.js'; import { getDatabase } from '../services/db.js';
@ -54,8 +54,8 @@ export function LiveArray(db, selector, watcher) {
const _watcher = watcher || Watcher(db, selector); const _watcher = watcher || Watcher(db, selector);
let changeSub = null; let changeSub = null;
const ready = observable(false); const ready = prop(false);
const data = observable({ docs: [] }); const data = prop({ docs: [] });
const docs = computed(r => r.docs, [data], pouchDocArrayComparator); const docs = computed(r => r.docs, [data], pouchDocArrayComparator);
const idSet = () => docs().reduce((acc, d) => acc.add(d._id), new Set()); const idSet = () => docs().reduce((acc, d) => acc.add(d._id), new Set());