Skip to content

Commit

Permalink
chore: add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
paoloricciuti committed Feb 17, 2025
1 parent e26d8ff commit 160bce5
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,9 @@ function build_element_attribute_update_assignment(

let { value, has_state } = build_attribute_value(attribute.value, context, (value, metadata) =>
metadata.has_call
? is_autofocus
? // if it's autofocus we will not add this to a template effect so we don't want to get the expression id
// but separately memoize the expression
is_autofocus
? memoize_expression(state, value)
: get_expression_id(state, value)
: value
Expand Down Expand Up @@ -678,7 +680,8 @@ function build_element_special_value_attribute(element, node_id, attribute, cont

const { value, has_state } = build_attribute_value(attribute.value, context, (value, metadata) =>
metadata.has_call
? is_select_with_value
? // if is a select with value we will also invoke `init_select` which need a reference before the template effect so we memoize separately
is_select_with_value
? memoize_expression(context.state, value)
: get_expression_id(state, value)
: value
Expand Down

0 comments on commit 160bce5

Please sign in to comment.