issue: https://linear.app/comm/issue/ENG-4681/create-action-objects-for-all-actions
We want to start migrating our actions to using useKeyserverCall. We need to create an object for each action that will contain the ActionFunc and a config.
Additionally we agreed to wrap the call to useKeyserverCall into a separate hook for every action. For more info see comments under https://linear.app/comm/issue/ENG-4440/refactor-redux-fields-second-iteration-refactor-actions
For now those hooks are very simple, but in the future they will contain more logic
Details
Details
Tested that all of the refactored actions work. Ran yarn flow-all.
Diff Detail
Diff Detail
- Repository
- rCOMM Comm
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Requesting changes because I have a few smaller comments
lib/actions/message-actions.js | ||
---|---|---|
40 ↗ | (On Diff #31312) | Should probably be renamed everywhere |
182–187 ↗ | (On Diff #31312) | |
541 ↗ | (On Diff #31312) | Shouldn't this be a specific endpoint? |
lib/utils/keyserver-id-extractors.js | ||
7–23 ↗ | (On Diff #31312) | Not sure if I'm a fan of this approach. Are we just going to be adding a new function whenever some action uses a different field name? I think I would prefer to have inline functions inside of the "config" objects and invariant inside of the extractKeyserverIDFromID function. |
lib/utils/action-utils.js | ||
---|---|---|
459 ↗ | (On Diff #31613) | This function is used in almost all diffs, so to not spend a lot of time on in I will update it in one diff at the top of the stack |