-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: reduce bundle size by limiting external dependencies (#276)
I removed external dependency of `flux-standard-action` that includes entire loadash with it when imported. Instead, I re-implemented single function we are using and relied on single modules from loadash that are required. Should reduce the size significantly
- Loading branch information
1 parent
5238bce
commit 0971fd3
Showing
4 changed files
with
42 additions
and
48 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
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import isPlainObject from 'lodash.isplainobject' | ||
import isString from 'lodash.isstring' | ||
|
||
export const isFSA = (action: FluxStandardAction): boolean => | ||
isPlainObject(action) && isString(action.type) && Object.keys(action).every(isValidKey) | ||
|
||
const isValidKey = (key: string) => ['type', 'payload', 'error', 'meta'].indexOf(key) > -1 | ||
|
||
export type FluxStandardAction<Meta = unknown> = { | ||
type: string | ||
payload?: unknown | ||
meta?: Meta | ||
} |
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