1
0
Fork 0
mirror of synced 2024-09-08 13:41:09 +12:00
This commit is contained in:
Andrew Kingston 2023-07-25 15:35:58 +01:00
parent b8bc25a39a
commit b82a34d7e1
6 changed files with 4 additions and 16 deletions

View file

@ -499,15 +499,9 @@
// Check if we already know if this key is used
let used = knownContextKeyMap[key]
// If we don't know, check
// If we don't know, check and cache
if (used == null) {
// Check HBS
if (bindingString.indexOf(`[${key}]`) !== -1) {
used = true
} else {
used = false
}
// Cache result
used = bindingString.indexOf(`[${key}]`) !== -1
knownContextKeyMap[key] = used
}

View file

@ -8,10 +8,8 @@
export let actions
export let key
// Clone and create new data context for this component tree
const context = getContext("context")
const component = getContext("component")
const providerKey = key || $component.id
// Generate a permanent unique ID for this component and use it to register

View file

@ -9,12 +9,10 @@ export const createContextStore = () => {
if (!providerId || data === undefined) {
return
}
// console.log(`[${providerId}]`, data)
context.update(state => {
state[providerId] = data
return state
})
broadcastChange(providerId)
}
@ -31,7 +29,6 @@ export const createContextStore = () => {
const observeChanges = callback => {
observers.push(callback)
return () => {
observers = observers.filter(cb => cb !== callback)
}

View file

@ -24,6 +24,5 @@ export const enrichDataBinding = async (input, context) => {
* Props are deeply cloned so that no mutation is done to the source object.
*/
export const enrichDataBindings = (props, context) => {
console.log("enrich")
return processObjectSync(Helpers.cloneDeep(props), context, { cache: true })
}

View file

@ -48,7 +48,7 @@
"@apidevtools/swagger-parser": "10.0.3",
"@budibase/backend-core": "0.0.0",
"@budibase/client": "0.0.0",
"@budibase/pro": "0.0.0",
"@budibase/pro": "develop",
"@budibase/shared-core": "0.0.0",
"@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0",

View file

@ -39,7 +39,7 @@
"license": "GPL-3.0",
"dependencies": {
"@budibase/backend-core": "0.0.0",
"@budibase/pro": "0.0.0",
"@budibase/pro": "develop",
"@budibase/string-templates": "0.0.0",
"@budibase/types": "0.0.0",
"@koa/router": "8.0.8",