Skip to content

Commit 7241ec5

Browse files
committed
Use case-map lib in a saner way.
In this file currently you can refer to the function as: caseMap.dashToCamelCase, CaseMap.dashToCamelCase, or dashToCamelCase. Let's just do a standard import style here.
1 parent 658d1cf commit 7241ec5

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

lib/mixins/property-effects.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,12 @@ import '../utils/boot.js';
1313
import { dedupingMixin } from '../utils/mixin.js';
1414
import { root as root$0, isAncestor, isDescendant, get as get$0, translate, isPath as isPath$0, set as set$0, normalize } from '../utils/path.js';
1515
/* for notify, reflect */
16-
import * as caseMap from '../utils/case-map.js';
17-
import { camelToDashCase as camelToDashCase$0, dashToCamelCase } from '../utils/case-map.js';
16+
import { camelToDashCase, dashToCamelCase } from '../utils/case-map.js';
1817
import { PropertyAccessors } from './property-accessors.js';
1918
/* for annotated effects */
2019
import { TemplateStamp } from './template-stamp.js';
2120
import { sanitizeDOMValue } from '../utils/settings.js';
2221

23-
/** @const {Object} */
24-
const CaseMap = caseMap;
25-
2622
// Monotonically increasing unique ID used for de-duping effects triggered
2723
// from multiple properties in the same turn
2824
let dedupeId = 0;
@@ -272,7 +268,7 @@ function runNotifyEffects(inst, notifyProps, props, oldProps, hasPaths) {
272268
function notifyPath(inst, path, props) {
273269
let rootProperty = root$0(path);
274270
if (rootProperty !== path) {
275-
let eventName = camelToDashCase$0(rootProperty) + '-changed';
271+
let eventName = camelToDashCase(rootProperty) + '-changed';
276272
dispatchNotifyEvent(inst, eventName, props[path], path);
277273
return true;
278274
}
@@ -492,7 +488,7 @@ function addBinding(constructor, templateInfo, nodeInfo, kind, target, parts, li
492488
// Add listener info to binding metadata
493489
if (shouldAddListener(binding)) {
494490
let {event, negate} = binding.parts[0];
495-
binding.listenerEvent = event || (CaseMap.camelToDashCase(target) + '-changed');
491+
binding.listenerEvent = event || (camelToDashCase(target) + '-changed');
496492
binding.listenerNegate = negate;
497493
}
498494
// Add "propagate" property effects to templateInfo
@@ -2127,7 +2123,7 @@ export const PropertyEffects = dedupingMixin(superClass => {
21272123
this._addPropertyEffect(property, TYPES.NOTIFY, {
21282124
fn: runNotifyEffect,
21292125
info: {
2130-
eventName: CaseMap.camelToDashCase(property) + '-changed',
2126+
eventName: camelToDashCase(property) + '-changed',
21312127
property: property
21322128
}
21332129
});

0 commit comments

Comments
 (0)