-
-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: minor, non-functional changes #876
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
registry = "https://registry.npmjs.org" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,6 @@ export default function extractDataFromModel( | |
const _aCD = {}; | ||
const _aC = {}; | ||
const _aRD = {}; | ||
const actionThunks = {}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As far as I can tell, this was never being used. All tests still pass. |
||
const _cP = []; | ||
const _cR = []; | ||
const _e = []; | ||
|
@@ -126,9 +125,6 @@ export default function extractDataFromModel( | |
// the thunk action is created/dispatched | ||
def.thunkHandler = createThunkHandler(def, _r, injections, _aC); | ||
|
||
// Register the thunk handler | ||
set(path, actionThunks, def.thunkHandler); | ||
|
||
Comment on lines
-129
to
-131
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe we don't have tests covering this? IDK what There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've tested this branch against our codebase, and we get 0 failures - so I guess this is fine. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, this is related to this change: #876 (comment). The only place |
||
// Create the "action creator" function | ||
def.actionCreator = createThunkActionsCreator(def, _r); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -212,3 +212,25 @@ export function useMemoOne( | |
|
||
return cache.result; | ||
} | ||
|
||
const logEventListenerError = (type, err) => { | ||
// eslint-disable-next-line no-console | ||
console.log(`Error in ${type}`); | ||
// eslint-disable-next-line no-console | ||
console.log(err); | ||
}; | ||
|
||
export const handleEventDispatchErrors = | ||
(type, dispatcher) => | ||
(...args) => { | ||
try { | ||
const result = dispatcher(...args); | ||
if (isPromise(result)) { | ||
result.catch((err) => { | ||
logEventListenerError(type, err); | ||
}); | ||
} | ||
} catch (err) { | ||
logEventListenerError(type, err); | ||
} | ||
}; | ||
Comment on lines
+216
to
+236
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make the code a bit more DRY by replacing repeated code with shared util. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ const noopStorage = { | |
removeItem: () => undefined, | ||
}; | ||
|
||
const getBrowerStorage = (storageName) => { | ||
const getBrowserStorage = (storageName) => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Whoops! |
||
let storageCache; | ||
return () => { | ||
if (!storageCache) { | ||
|
@@ -30,8 +30,8 @@ const getBrowerStorage = (storageName) => { | |
}; | ||
}; | ||
|
||
const localStorage = getBrowerStorage('localStorage'); | ||
const sessionStorage = getBrowerStorage('sessionStorage'); | ||
const localStorage = getBrowserStorage('localStorage'); | ||
const sessionStorage = getBrowserStorage('sessionStorage'); | ||
|
||
function createStorageWrapper(storage, transformers = [], migrations = {}) { | ||
if (storage == null) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For devs that use private NPM registries. Avoid conflicts with commands like
npm publish