-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor: Replace use of key-mirror with inline code (#29857)
The `key-mirror` package is useful but not enough to warrant pulling in the dependency. It was being referenced in only a few files and this change replaces those instances where we were using it with the code the produces the same effect. It's actually so trivial of a change that the warrant for removing the library and the function calls should be obvious. **Before** ```js const items = keyMirror( { ONE: null, TWO: null, THREE: null, } ); ``` **After** ```js const items = { ONE: 'ONE', TWO: 'TWO', THREE: 'THREE', }; ```
- Loading branch information
Showing
8 changed files
with
160 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,19 @@ | ||
/** @format */ | ||
|
||
/** | ||
* External dependencies | ||
*/ | ||
|
||
import keyMirror from 'key-mirror'; | ||
|
||
/** | ||
* Module variables | ||
*/ | ||
export const action = keyMirror( { | ||
FETCH_INVITE: null, | ||
RECEIVE_INVITE: null, | ||
RECEIVE_INVITE_ERROR: null, | ||
INVITE_ACCEPTED: null, | ||
RECEIVE_INVITE_ACCEPTED_SUCCESS: null, | ||
RECEIVE_INVITE_ACCEPTED_ERROR: null, | ||
SENDING_INVITES: null, | ||
RECEIVE_SENDING_INVITES_ERROR: null, | ||
RECEIVE_SENDING_INVITES_SUCCESS: null, | ||
CREATE_INVITE_VALIDATION: null, | ||
RECEIVE_CREATE_INVITE_VALIDATION_ERROR: null, | ||
RECEIVE_CREATE_INVITE_VALIDATION_SUCCESS: null, | ||
} ); | ||
export const action = { | ||
FETCH_INVITE: 'FETCH_INVITE', | ||
RECEIVE_INVITE: 'RECEIVE_INVITE', | ||
RECEIVE_INVITE_ERROR: 'RECEIVE_INVITE_ERROR', | ||
INVITE_ACCEPTED: 'INVITE_ACCEPTED', | ||
RECEIVE_INVITE_ACCEPTED_SUCCESS: 'RECEIVE_INVITE_ACCEPTED_SUCCESS', | ||
RECEIVE_INVITE_ACCEPTED_ERROR: 'RECEIVE_INVITE_ACCEPTED_ERROR', | ||
SENDING_INVITES: 'SENDING_INVITES', | ||
RECEIVE_SENDING_INVITES_ERROR: 'RECEIVE_SENDING_INVITES_ERROR', | ||
RECEIVE_SENDING_INVITES_SUCCESS: 'RECEIVE_SENDING_INVITES_SUCCESS', | ||
CREATE_INVITE_VALIDATION: 'CREATE_INVITE_VALIDATION', | ||
RECEIVE_CREATE_INVITE_VALIDATION_ERROR: 'RECEIVE_CREATE_INVITE_VALIDATION_ERROR', | ||
RECEIVE_CREATE_INVITE_VALIDATION_SUCCESS: 'RECEIVE_CREATE_INVITE_VALIDATION_SUCCESS', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 6 additions & 12 deletions
18
client/my-sites/domains/domain-management/domain-connect/constants.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.