Skip to content
This repository has been archived by the owner on Apr 17, 2023. It is now read-only.

Allow to provide custom data mapping. #25

Open
wtrocki opened this issue Jul 17, 2017 · 0 comments
Open

Allow to provide custom data mapping. #25

wtrocki opened this issue Jul 17, 2017 · 0 comments

Comments

@wtrocki
Copy link
Member

wtrocki commented Jul 17, 2017

Sync currently in most of the times returns specific format of dataset:

{ 
  uid: "myid", 
  data: {name:"mydata"}
}

This format is not flexible and in most of the cases it will be better to integrate id into actual data.
Most of the sync implementations doing that anyway.

Example code for formatter:

_.values(syncResponse).map((syncData: any) => {
    // Change format of the data by mapping id's
    syncData.data.uid = syncData.uid
    // Only interested in the actual data from the sync response
    return syncData.data;
  });
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant