Tidy up
This commit is contained in:
parent
b8bc25a39a
commit
b82a34d7e1
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
|
|
|
@ -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 })
|
||||
}
|
||||
|
|
|
@ -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",
|
||||
|
|
|
@ -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",
|
||||
|
|
Loading…
Reference in New Issue