@sitecore-feaas/clientside 0.1.55 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,7 +15,7 @@ const convertSchemaPropertiesToKebabCase = (schema: any) => {
15
15
  return acc
16
16
  }, {})
17
17
 
18
- kebabRequiredProperties = schema.required.map((item: string) => kebabCase(item))
18
+ kebabRequiredProperties = (schema.required || []).map((item: string) => kebabCase(item))
19
19
  }
20
20
  return { ...schema, properties: kebabSchemaProperties, required: kebabRequiredProperties }
21
21
  }
@@ -79,12 +79,13 @@ export default class FEAASExternal extends FEAASBase<FEAASExternalProps, ReactMo
79
79
  const id = schema.name || component.name
80
80
  const enrichedSchema = { ...schema, title: id, type: 'object' }
81
81
  FEAASExternal.registered[id] = { component, schema: enrichedSchema }
82
+ FEAASExternal.setRegistrationCallback()
82
83
  }
83
84
 
84
85
  static setRegistrationCallback() {
85
- // if registerCallback has not already been triggered by another component, set it
86
- if (!FEAASExternal.registrationCallback && typeof window !== 'undefined') {
87
- FEAASExternal.registrationCallback = setTimeout(() => {
86
+ clearTimeout(FEAASExternal.registrationCallback)
87
+ FEAASExternal.registrationCallback = setTimeout(() => {
88
+ if (typeof window !== 'undefined') {
88
89
  // create components array from object
89
90
  const components = Object.keys(FEAASExternal.registered).map((id) => ({
90
91
  ...FEAASExternal.registered[id],
@@ -101,8 +102,8 @@ export default class FEAASExternal extends FEAASBase<FEAASExternalProps, ReactMo
101
102
  }),
102
103
  '*'
103
104
  )
104
- }, 500)
105
- }
105
+ }
106
+ }, 30)
106
107
  }
107
108
 
108
109
  /*static loadComponents() {