Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace keepValue with better solution for translating values #270

Merged
merged 4 commits into from Jan 5, 2020

Conversation

dxinteractive
Copy link
Collaborator

@dxinteractive dxinteractive commented Jan 4, 2020

Addresses #264, #265

dataparcels

  • Allow Parcel.metaAsParcel() to be passed the meta from the original parcel, and to pass changes to meta back to the original parcel
  • Add dataparcels/translate to replace the functionality of ParcelBoundary's keepValue prop but in a way that supports multiple input instances, keep co-dependent code logic together, and uses far less code.
// before
let numberToString = parcel => parcel
    .modifyDown(number => `${number}`)
    .modifyUp(string => Number(string));

<ParcelBoundary parcel={myParcel.pipe(numberToString)} keepValue>

// after
let numberToString = translate({
    down: number => `${number}`
    up: string => Number(string),
    preserveInput: true
});

<ParcelBoundary parcel={myParcel.pipe(numberToString)}>

react-dataparcels

  • BREAKING CHANGE removed ParcelBoundary's keepValue prop

To upgrade

  • Find all keepValue, remove, use translate instead

@dxinteractive dxinteractive changed the title Feature/meta as parcel Replace keepValue with better solution for translating values Jan 4, 2020
@dxinteractive dxinteractive merged commit 5c9537d into release/strict-swift Jan 5, 2020
@dxinteractive dxinteractive deleted the feature/meta-as-parcel branch January 5, 2020 23:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants