Skip to content
This repository was archived by the owner on Oct 19, 2020. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ Settable at any time:
Name | Type | Description
--- | --- | ---
displayName | String | A human-readable name for the function, used for debug output and warnings.
useConsoleGroup | Boolean | Will cause verbose logging to be nested in console groups.
useConsoleGroup | Boolean | Will wrap other logging calls in console groups.
runLoggingEnabled | Boolean | Will output general log information at the beginning and end of each selector invokation.
verboseLoggingEnabled | Boolean | Will fill your console with far too much debug info. This will be cleaned up in the near future.
verboseLoggingCallback | Function | Gets called for every verboseLogging item; this is `console.log` by default.
performanceChecksEnabled | Boolean | Will give you warnings or pings if something causes a selector to re-run unnecessarily, or if it encounters other bad smells. (Not yet implemented.)
Expand All @@ -185,3 +186,4 @@ onSkippedRun | Function | Callback fired when a selector returns its cached valu
onPhantomRun | Function | Callback fired when a selector runs but returns something equivalent to its cached value. Useful for debugging.
onFullRun | Function | Callback fired when a selector runs and returns a new value. Useful for debugging.
onAbortedRun | Function | Callback fired when a selector needs to run but isn't allowed to because it's being queried (e.g., for `hasCachedResult`.) Useful for debugging.
onErrorRun | Function | Callback fired when a selector throws an exception. Useful for debugging.
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"url": "git+https://github.com/spautz/parameterized-selectors.git"
},
"scripts": {
"test": "nyc mocha --require babel-core/register tests/",
"test": "nyc mocha --require babel-core/register tests/*",
"lint": "eslint .",
"sendCoverage": "nyc report --reporter=text-lcov | coveralls"
},
Expand Down Expand Up @@ -40,6 +40,7 @@
"eslint": "^5.2.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-plugin-import": "^2.13.0",
"immer": "1.8.0",
"mocha": "^5.2.0",
"nyc": "^12.0.2"
}
Expand Down
5 changes: 4 additions & 1 deletion src/defaultOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const willThrowErrorIfNotSet = label => () => {
* if the consumer ever needs to reference the original value, after setting new defaults.
*/
const defaultInitialOptions = {
displayNamePrefix: 'parameterizedSelector',
displayNamePrefix: 'parameterizedSelector:',
compareIncomingStates: COMPARISON_PRESETS.SAME_REFERENCE,
compareSelectorResults: COMPARISON_PRESETS.SHALLOW_EQUAL,
exceptionCallback: (errorMessage, error) => {
Expand All @@ -38,6 +38,8 @@ const defaultOptions = {
// Some options can be changed anytime
displayName: null,
useConsoleGroup: true,
runLoggingEnabled: false,
runLoggingCallback: console.log, // eslint-disable-line no-console
verboseLoggingEnabled: false,
verboseLoggingCallback: console.log, // eslint-disable-line no-console
performanceChecksEnabled: (typeof __DEV__ !== 'undefined' && !!__DEV__),
Expand All @@ -51,6 +53,7 @@ const defaultOptions = {
onPhantomRun: null,
onFullRun: null,
onAbortedRun: null,
onErrorRun: null,
};

// Note that there is no `setDefaultOptions`:
Expand Down
3 changes: 3 additions & 0 deletions src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,9 @@ const KEY_PRESETS = {
if (obj && typeof obj === 'object') {
return JSON.stringify(obj);
}
if (obj == null) {
return '{}';
}
return String(obj);
},
JSON_STRING_WITH_STABLE_KEYS: (obj) => {
Expand Down
Loading