I understand how dataLoader works with simple keys:
import DataLoader from 'dataloader';
import myService from './services/service';
export default () => new DataLoader((keys: any) => Promise.all(keys.map((key: string) => myService(key))));
Is there a good pattern for using composite keys?
What if I need to call the google maps api using something like lat and long? My key would need to be a unique combination of the lat and long and I would need to split the lat and long when calling my service
const key = `${latitude}|${longitude}`;
Thinking I could use a map to lookup the value to pass to my service based on the key, is there a good pattern for use cases like this?