Rename chain function to all

This commit is contained in:
Andreas Hocevar
2020-06-13 08:37:46 +02:00
parent 3de2ea0624
commit dbe080d362
3 changed files with 8 additions and 8 deletions

View File

@@ -14,11 +14,11 @@ import {assert} from '../asserts.js';
*/
/**
* Creates a condition function that is only fulfilled when a chain of conditions pass.
* Creates a condition function that passes when all provided conditions pass.
* @param {...Condition} var_args Conditions to check.
* @return {Condition} Condition function that checks a chain of conditions.
* @return {Condition} Condition function.
*/
export function chain(var_args) {
export function all(var_args) {
const conditions = arguments;
/**
* @param {import("../MapBrowserEvent.js").default} event Event.

View File

@@ -6,7 +6,7 @@ import PointerInteraction, {
} from './Pointer.js';
import {FALSE} from '../functions.js';
import {
chain,
all,
focusWithTabindex,
noModifierKeys,
primaryAction,
@@ -66,14 +66,14 @@ class DragPan extends PointerInteraction {
const condition = options.condition
? options.condition
: chain(noModifierKeys, primaryAction);
: all(noModifierKeys, primaryAction);
/**
* @private
* @type {import("../events/condition.js").Condition}
*/
this.condition_ = options.onFocusOnly
? chain(focusWithTabindex, condition)
? all(focusWithTabindex, condition)
: condition;
/**

View File

@@ -4,7 +4,7 @@
import EventType from '../events/EventType.js';
import Interaction, {zoomByDelta} from './Interaction.js';
import {DEVICE_PIXEL_RATIO, FIREFOX} from '../has.js';
import {always, chain, focusWithTabindex} from '../events/condition.js';
import {all, always, focusWithTabindex} from '../events/condition.js';
import {clamp} from '../math.js';
/**
@@ -103,7 +103,7 @@ class MouseWheelZoom extends Interaction {
* @type {import("../events/condition.js").Condition}
*/
this.condition_ = options.onFocusOnly
? chain(focusWithTabindex, condition)
? all(focusWithTabindex, condition)
: condition;
/**