Skip to content

Feature Request: Enhance ASC to Expand Atom/AtomFamily Default Dependency Traversal Scenarios #53

@JaysonGCS

Description

@JaysonGCS

Summary of the new feature/enhancement

Recently, we have added support for ASC to detect atom and atomFamily "default" property's dependency. However, it is unable to walk the scenario when the property type is a function, e.g.,

export const exampleSelector = selectorFamily<string, string>({
  key: 'exampleSelector',
  get: (prop: string) => () => prop,
});

export const exampleAtomFam = atomFamily<string, { prop: string }>({
  key: 'exampleAtomFam',
  default: (params) => {
    const { prop } = params;
    return exampleSelector(prop);
  },
});

Proposed technical implementation details (optional)

Similar to how we enhanced ASC to detect the naive "default" property in the following commit:
1a2f170#diff-e7666a81d414fa99d669f5edf757decdfe76c0b7bbc0e9bdf2c365a26cca98f2

We can enhance this function to expand the traversal scenarios.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions