Skip to content

useParcelForm with promises, revertable changes, drag with render props

Compare
Choose a tag to compare
@dxinteractive dxinteractive released this 06 Jun 05:57
· 175 commits to master since this release

Addresses #181 #182 #214

react-dataparcels

  • BREAKING CHANGE useParcelBuffer now submits when buffer is empty
    • before, calling submit on an empty buffer did nothing, but this makes it very difficult to resubmit, and considering how easy it is to cancel a change based on whats in it (i.e. changeRequest.hasValueChanged()) then changing this behaviour makes it easier to use in general
  • Add ability for useParcelForm() onChange to return promise, and changes are halted until resolve
    • subsequent submits are queued behind pending onChange
    • rejected onChanges are retried if other changes are submitted before all onChanges complete
    • if final onChange rejects, the ChangeRequest is pushed back down into the parcel buffer so editing can continue seamlessly
    • added an internal useParcelSideEffect() hook to do all the above
  • Add useParcelForm() onChangeUseResult option, so that the result of onChange can set the value in useParcelForm() state

react-dataparcels-drag

  • BREAKING CHANGE react-dataparcels-drag is used as a render props component rather than as a hoc. See docs for details on how to upgrade.