Skip to content

Mapping with runtime arguments? #211

Description

@aahventures

More of a question than a feature request, but I thought it was more appropriate than creating a bug.

Is your feature request related to a problem? Please describe.
I have a different look up table for different tenants, and would like to drop it in at runtime.

Describe the solution you'd like
Something like https://automapperts.netlify.app/docs/mapping-configuration/map-with-arguments

Describe alternatives you've considered
Considering https://github.com/nartc/mapper or writing wrapper code, something like

createSchemaWithContext(lookup: Lookup) {
  return createSchema<Destination, Source>({
    countryCode: s => lookup.country(s.countryId).code;
  });
}

I'm not sure what the best approach is. Any advice is appreciated.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions