Add pick to frptools. Document all utility functions
This commit is contained in:
parent
393c9f5e26
commit
a8a55654d8
@ -1,8 +1,7 @@
|
|||||||
import { prop, computed, container } from 'frptools';
|
import { prop, computed, container, pick } from 'frptools';
|
||||||
|
|
||||||
import { Icon } from './icon.js';
|
import { Icon } from './icon.js';
|
||||||
import { defineElement as el, subscribeToRender } from '../../utils/domvm.js';
|
import { defineElement as el, subscribeToRender } from '../../utils/domvm.js';
|
||||||
import { pick } from '../../utils/conversion.js';
|
|
||||||
import { injectStyle, styled } from '../../services/style.js';
|
import { injectStyle, styled } from '../../services/style.js';
|
||||||
import { CLICKABLE } from '../styles.js';
|
import { CLICKABLE } from '../styles.js';
|
||||||
|
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
import { readAsArrayBuffer } from 'pouchdb-binary-utils';
|
import { readAsArrayBuffer } from 'pouchdb-binary-utils';
|
||||||
|
import { pick } from 'frptools';
|
||||||
|
|
||||||
import { isObject } from './comparators';
|
import { isObject } from './comparators';
|
||||||
|
|
||||||
export function bufferToHexString(buffer) {
|
export function bufferToHexString(buffer) {
|
||||||
@ -45,8 +47,6 @@ export function deepAssign(to, ...rest) {
|
|||||||
return to;
|
return to;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const pick = (id, def) => doc => (doc && doc.hasOwnProperty(id) ? doc[id] : def);
|
|
||||||
|
|
||||||
export const extractID = pick('_id');
|
export const extractID = pick('_id');
|
||||||
export const extractREV = pick('_rev');
|
export const extractREV = pick('_rev');
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user