Skip to content

Commit 4e81cdc

Browse files
author
Mark Lozano
committed
Changing logging option name
1 parent f3402ea commit 4e81cdc

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

src/reactor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@ class Reactor {
2929
const baseOptions = debug ? DEBUG_OPTIONS : PROD_OPTIONS
3030
// if defined, merge the custom implementation over the noop logger to avoid undefined lookups,
3131
// otherwise, just use the built-in console group logger
32-
const debugLogger = config.logging ? extend({}, NoopLogger, config.logging) : ConsoleGroupLogger
32+
const debugLogger = config.logger ? extend({}, NoopLogger, config.logger) : ConsoleGroupLogger
3333
const initialReactorState = new ReactorState({
3434
debug: debug,
3535
cache: config.cache || DefaultCache(),
36-
logging: debug ? debugLogger : NoopLogger,
36+
logger: debug ? debugLogger : NoopLogger,
3737
// merge config options with the defaults
3838
options: baseOptions.merge(config.options || {}),
3939
})

src/reactor/fns.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export function replaceStores(reactorState, stores) {
7373
* @return {ReactorState}
7474
*/
7575
export function dispatch(reactorState, actionType, payload) {
76-
let logging = reactorState.get('logging')
76+
let logging = reactorState.get('logger')
7777

7878
if (actionType === undefined && getOption(reactorState, 'throwOnUndefinedActionType')) {
7979
throw new Error('`dispatch` cannot be called with an `undefined` action type.');

src/reactor/records.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export const ReactorState = Record({
4141
state: Map(),
4242
stores: Map(),
4343
cache: DefaultCache(),
44-
logging: NoopLogger,
44+
logger: NoopLogger,
4545
// maintains a mapping of storeId => state id (monotomically increasing integer whenever store state changes)
4646
storeStates: Map(),
4747
dirtyStores: Set(),

tests/reactor-tests.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ describe('Reactor', () => {
7878
it('should use dispatchStart on the provided logging handler if defined', () => {
7979
var reactor = new Reactor({
8080
debug: true,
81-
logging: handler,
81+
logger: handler,
8282
})
8383

8484
reactor.dispatch('setTax', 5)
@@ -88,7 +88,7 @@ describe('Reactor', () => {
8888
it('should use dispatchEnd on the provided logging handler if defined', () => {
8989
var reactor = new Reactor({
9090
debug: true,
91-
logging: handler,
91+
logger: handler,
9292
})
9393

9494
reactor.dispatch('setTax', 5)
@@ -98,7 +98,7 @@ describe('Reactor', () => {
9898
it('should use dispatchError on the provided logging handler if defined', () => {
9999
var reactor = new Reactor({
100100
debug: true,
101-
logging: handler,
101+
logger: handler,
102102
options: {
103103
throwOnUndefinedActionType: false,
104104
},
@@ -113,7 +113,7 @@ describe('Reactor', () => {
113113
it('should use the NoopLogger implementation when a logging function is not defined on the custom implementation', () => {
114114
var reactor = new Reactor({
115115
debug: true,
116-
logging: {
116+
logger: {
117117
dispatchStart() {},
118118
dispatchEnd() {},
119119
},

0 commit comments

Comments
 (0)