Skip to content

Conversation

@maxschmeling
Copy link
Contributor

@maxschmeling maxschmeling commented Mar 18, 2025

Uses the getValues argument of registerBlockBindingsSource to retrieve binding values async with core data.

// console.log('store: RECEIVED REMOTE DATA')
// console.log({action});
// console.log(`key: ${queryDataStateKey(action.queryKey, action.blockName, action.queryInput)}`);
return { ...state, [ queryDataStateKey(action.queryKey, action.blockName, action.queryInputs) ]: action.data };
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each query response contains a UUID in the resultId property. Maybe we should use that?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, that won't work since the UUIDs will be different on subsequent page loads. 👎

usesContext: [ 'remote-data-blocks/remoteData' ],
getValues() {
return {};
getValues( { context, clientId, bindings, select, ...other } ) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we be using setValues too? Or should we be dispatching actions from useRemoteData()?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants