-
Notifications
You must be signed in to change notification settings - Fork 669
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrating with Roles. Refactoring.
- Loading branch information
1 parent
e970116
commit 2dc0753
Showing
5 changed files
with
84 additions
and
34 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,46 @@ | ||
// ------------------------------------------------------------- | ||
// WARNING: this file is used by both the client and the server. | ||
// Do not use any browser or node-specific API! | ||
// ------------------------------------------------------------- | ||
import { assignIn } from 'lodash'; | ||
import Assignable from '../utils/assignable'; | ||
|
||
|
||
export default class BrowserConsoleMessages extends Assignable { | ||
constructor (obj) { | ||
super(); | ||
|
||
this.log = []; | ||
this.info = []; | ||
this.warn = []; | ||
this.error = []; | ||
|
||
this._assignFrom(obj); | ||
} | ||
|
||
_getAssignableProperties () { | ||
return [ | ||
{ name: 'log' }, | ||
{ name: 'info' }, | ||
{ name: 'warn' }, | ||
{ name: 'error' } | ||
]; | ||
} | ||
|
||
concat (consoleMessages) { | ||
this.log = this.log.concat(consoleMessages.log); | ||
this.info = this.info.concat(consoleMessages.info); | ||
this.warn = this.warn.concat(consoleMessages.warn); | ||
this.error = this.error.concat(consoleMessages.error); | ||
} | ||
|
||
addMessage (type, msg) { | ||
this[type].push(msg); | ||
} | ||
|
||
getCopy () { | ||
const { log, info, warn, error } = this; | ||
|
||
return assignIn({}, { log, info, warn, error }); | ||
} | ||
} |
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