cashapp/misk-web

RFC: Merge simpleForm and simpleNetwork

Closed this issue · 3 comments

adrw commented

After working with both for the first many tabs, the reason to have them in separate reducers is less clear.

To provide functionality of a network call updating form fields for example, a single simple* reducer would allow for easier implementation of boundary crossing sagas.

Addition of further functionality for router or other aspects also becomes easier because a manual migration to add the types and other ducks elements isn’t necessary. It will all come for free with a version bump.

adrw commented

Plan

  • (#530) No-op movement of files from simpleForm and simpleNetwork to simpleRedux
  • (#562) Rename dispatchers to more relevant names (simpleFormInput -> simpleCache?, simpleNetworkGet -> simpleAxiosGet). Deprecate old names with console warnings and use new dispatchers under the hood
  • (#641) Add new dispatcher that handles mapper function
  • Move createSimpleSelector{Get,Pick} to Ducks to have the selector created once and maximize usage of caching
  • (drop) Add new dispatcher that handles a Promise (mergeSaga is sufficient)
  • (drop) Add support for chaining (mergeSaga is sufficient)
adrw commented

Spoke offline with @jaredwindover through some of the considerations involved with above (Redux store size for example), he didn't have any concerns with the approach above.

adrw commented

Merged in #641