Skip to content
This repository has been archived by the owner on Jun 27, 2018. It is now read-only.

[RFR] Clarify the map() logic #20

Merged
merged 6 commits into from
Jul 9, 2015
Merged

[RFR] Clarify the map() logic #20

merged 6 commits into from
Jul 9, 2015

Conversation

fzaninotto
Copy link
Member

  • map() turns a JS object to an entry
  • transform() turns an entry into a JS object
  • Moved the map logic to fields and views, removed it from Datastore.
  • Allowed to define fields for nested objects (i.e. new Field('foo.bar'))

This is not a BC break, but it deprecates DataStore.mapEntry() and DataStore.mapEntries(), in favor of Entry.createFromRest(restEntry) and entry.transformToRest(). Will log warnings about the deprecation.

Required for marmelab/ng-admin#549

- map() turns a JS object to an entry
- transform() turns an entry into a JS object

Moved the map logic to fields and views, removed it from Entry and
Datastore
@fzaninotto fzaninotto changed the title [WIP] Clarify the map() logic [RFR] Clarify the map() logic Jul 9, 2015
@fzaninotto
Copy link
Member Author

Switching to RFR

jeromemacias added a commit that referenced this pull request Jul 9, 2015
[RFR] Clarify the map() logic
@jeromemacias jeromemacias merged commit 0e9f49c into master Jul 9, 2015
@jeromemacias jeromemacias deleted the map_transform branch July 9, 2015 11:36
@fzaninotto
Copy link
Member Author

Note that these changes will cause warnings in react-admin until the DataStore method calls are removed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants