1
0
Fork 0
mirror of synced 2024-09-20 03:08:18 +12:00
budibase/packages/builder/src/builderStore/insertCodeMetadata.js
Michael Shanks 56c25fee90 Client Api - New state binding method (#105)
* new binding...
- state manager
- one store per screen
- not passing

* client lib binding - tests passing

* binding fully working again post stateManager

* bugfix with button component

* Control flow ("code") now working, tests passing

* Events List now reading from component definition

* fix to button.svelte - missing props._children
2020-02-18 12:29:38 +00:00

17 lines
385 B
JavaScript

export const insertCodeMetadata = props => {
if (props._code && props._code.length > 0) {
props._codeMeta = codeMetaData(props._code)
}
if (!props._children || props._children.length === 0) return
for (let child of props._children) {
insertCodeMetadata(child)
}
}
const codeMetaData = code => {
return {
dependsOnStore: RegExp(/(store.)/g).test(code),
}
}