Skip to content

Commit ce80330

Browse files
Use blockBindingsBySource name
1 parent c4bf3dd commit ce80330

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

packages/block-editor/src/hooks/use-bindings-attributes.js

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export const withBlockBindingSupport = createHigherOrderComponent(
121121

122122
const attributes = {};
123123

124-
const bindingsBySource = new Map();
124+
const blockBindingsBySource = new Map();
125125

126126
for ( const [ attributeName, binding ] of Object.entries(
127127
blockBindings
@@ -135,16 +135,16 @@ export const withBlockBindingSupport = createHigherOrderComponent(
135135
continue;
136136
}
137137

138-
bindingsBySource.set( source, {
139-
...bindingsBySource.get( source ),
138+
blockBindingsBySource.set( source, {
139+
...blockBindingsBySource.get( source ),
140140
[ attributeName ]: {
141141
args: sourceArgs,
142142
},
143143
} );
144144
}
145145

146-
if ( bindingsBySource.size ) {
147-
for ( const [ source, bindings ] of bindingsBySource ) {
146+
if ( blockBindingsBySource.size ) {
147+
for ( const [ source, bindings ] of blockBindingsBySource ) {
148148
// Get values in batch if the source supports it.
149149
const values = source.getValues( {
150150
registry,
@@ -190,7 +190,7 @@ export const withBlockBindingSupport = createHigherOrderComponent(
190190
}
191191

192192
const keptAttributes = { ...nextAttributes };
193-
const bindingsBySource = new Map();
193+
const blockBindingsBySource = new Map();
194194

195195
// Loop only over the updated attributes to avoid modifying the bound ones that haven't changed.
196196
for ( const [ attributeName, newValue ] of Object.entries(
@@ -208,8 +208,8 @@ export const withBlockBindingSupport = createHigherOrderComponent(
208208
if ( ! source?.setValues ) {
209209
continue;
210210
}
211-
bindingsBySource.set( source, {
212-
...bindingsBySource.get( source ),
211+
blockBindingsBySource.set( source, {
212+
...blockBindingsBySource.get( source ),
213213
[ attributeName ]: {
214214
args: binding.args,
215215
newValue,
@@ -218,8 +218,11 @@ export const withBlockBindingSupport = createHigherOrderComponent(
218218
delete keptAttributes[ attributeName ];
219219
}
220220

221-
if ( bindingsBySource.size ) {
222-
for ( const [ source, bindings ] of bindingsBySource ) {
221+
if ( blockBindingsBySource.size ) {
222+
for ( const [
223+
source,
224+
bindings,
225+
] of blockBindingsBySource ) {
223226
source.setValues( {
224227
registry,
225228
context,

0 commit comments

Comments
 (0)