-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use getValues for bindings #426
base: trunk
Are you sure you want to change the base?
Conversation
// 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 }; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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. 👎
registerBlockBindingsSource( { | ||
name: 'remote-data/binding', | ||
label: 'Remote Data Binding', | ||
usesContext: [ 'remote-data-blocks/remoteData' ], | ||
getValues() { | ||
return {}; | ||
getValues( { context, clientId, bindings, select, ...other } ) { |
There was a problem hiding this comment.
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()
?
Uses the
getValues
argument ofregisterBlockBindingsSource
to retrieve binding values async with core data.