We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
x => x
Just ran across these lovely functions in the wild:
createSelector
export const selectFlag = createSelector( [ (state: RootState, namespaceKey: string, key: string) => { const flags = state.flags.flags[namespaceKey]; if (flags) { return flags[key] || ({} as IFlag); } return {} as IFlag; } ], (flag) => flag ); export const selectNamespaces = createSelector( [ (state: RootState) => Object.entries(state.namespaces.namespaces).map( ([_, value]) => value ) as INamespace[] ], (namespaces) => namespaces ); export const selectCurrentNamespace = createSelector( [ (state: RootState) => { if (state.namespaces.namespaces[state.namespaces.currentNamespace]) { return state.namespaces.namespaces[state.namespaces.currentNamespace]; } return { key: 'default', name: 'Default', description: '' } as INamespace; } ], (currentNamespace) => currentNamespace );
These are broken in two ways:
We've got warnings for the first, but not for the second.
Here's another example:
export const helmChartsSelector = createSelector( (state: RootState) => state.main.helmChartMap, helmCharts => helmCharts );
This isn't necessary and shouldn't even be memoized.
A really hacky thing to do would be:
args.length === 1 && args[0] === body
I'm actually seriously considering us adding this
Possible resources:
The text was updated successfully, but these errors were encountered:
Even better, Lenz just came up with this nonsense:
function checkErroneousResultFunction(resultFn){ let wtf = false try { const obj = {} if (resultFn(obj) === obj) wtf = true } catch {} if (wtf) { throw new Error("RTFM") } }
Sorry, something went wrong.
identityFunctionCheck
I believe this one has been resolved by #645.
No branches or pull requests
Just ran across these lovely functions in the wild:
createSelector
usage is incorrect and broken flipt-io/flipt#2444These are broken in two ways:
x => x
We've got warnings for the first, but not for the second.
Here's another example:
This isn't necessary and shouldn't even be memoized.
A really hacky thing to do would be:
args.length === 1 && args[0] === body
(conceptually. probably multiple ways to do this, ranging from actual parsing to a regex or something)I'm actually seriously considering us adding this
Possible resources:
The text was updated successfully, but these errors were encountered: