neuland / micro-frontends

extending the microservice paradigms to web development
https://micro-frontends.org/
MIT License
4.54k stars 475 forks source link

Universal Composition: Render Call Question #60

Closed ThanosAlmighty closed 2 years ago

ThanosAlmighty commented 2 years ago

Noticed a call to a render(sku) function on line 23 from the sibling level import of render.js

image

When I look at the function in the file, however, the static function name is actually renderRecos().

image

Is this a typo, or am I missing something?

naltatis commented 2 years ago

renderRecos is the default export of the render.js file. In custom-element.js imports the module and saves the default export under the name render locally. I could also have omitted the renderRecos name and only provide an anonymous function but I named it for better readability.

ThanosAlmighty commented 2 years ago

renderRecos is the default export of the render.js file. In custom-element.js imports the module and saves the default export under the name render locally. I could also have omitted the renderRecos name and only provide an anonymous function but I named it for better readability.

Okay! This is just my lack of familiarity with raw JS. Thanks for clarifying