Skip to content

Commit

Permalink
fix: minor refactor to reduce code size (#406)
Browse files Browse the repository at this point in the history
  • Loading branch information
nolanlawson committed Mar 9, 2024
1 parent 15bca21 commit 55872ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 5 additions & 2 deletions src/picker/components/Picker/framework.js
Expand Up @@ -2,6 +2,7 @@ import { getFromMap, parseTemplate, toString } from './utils.js'

const parseCache = new WeakMap()
const domInstancesCache = new WeakMap()
// This needs to be a symbol because it needs to be different from any possible output of a key function
const unkeyedSymbol = Symbol('un-keyed')

// for debugging
Expand Down Expand Up @@ -201,8 +202,10 @@ function parse (tokens) {

bindings.push(binding)

// add a placeholder comment that we can find later
htmlString += (!withinTag && !withinAttribute) ? `<!--${bindings.length - 1}-->` : ''
if (!withinTag && !withinAttribute) {
// add a placeholder comment that we can find later
htmlString += `<!--${bindings.length - 1}-->`
}
}

const template = parseTemplate(htmlString)
Expand Down
2 changes: 0 additions & 2 deletions src/picker/components/Picker/reactivity.js
Expand Up @@ -38,7 +38,6 @@ export function createState (abortSignal) {

const state = new Proxy({}, {
get (target, prop) {
// console.log('reactivity: get', prop)
if (currentObserver) {
let observers = propsToObservers.get(prop)
if (!observers) {
Expand All @@ -50,7 +49,6 @@ export function createState (abortSignal) {
return target[prop]
},
set (target, prop, newValue) {
// console.log('reactivity: set', prop, newValue)
target[prop] = newValue
const observers = propsToObservers.get(prop)
if (observers) {
Expand Down

0 comments on commit 55872ba

Please sign in to comment.