Skip to content

Automatic Parameter Setting for Lazy Loaded Components #157

Description

@grantcopley

Objective

Enhance the lazy loading functionality in CBWIRE by automatically setting any passed-in parameters to the data properties of the component, even when an onMount method is not defined.

Details

When using CBWIRE to lazy load a component and passing parameters, it is currently necessary to define an onMount(params) method in the component and manually assign the parameters to the data properties. For example:

#wire( name="SimilarStyles", params={ "apparelId": apparelId }, lazy=true )#

This requires the component to have an onMount method like:

onMount(params) {
    this.data.apparelId = params.apparelId;
}

If the onMount method is not defined, the parameters are not automatically set. However, when not lazy loading, CBWIRE already handles this automatic parameter setting. The goal is to extend this functionality to lazy loaded components, allowing for a more seamless and less error-prone experience.

Expected Functionality

CBWIRE should automatically set any passed-in parameters to the data properties of a component, even when the component is lazy loaded and no onMount method is defined.
This will align the behavior of lazy loaded components with that of non-lazy loaded components, reducing the need for redundant code and potential errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions