<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>
-
URL
<The URL Structure (path only, no root url)>
-
Method:
export default ( | |
label, | |
componentName, | |
prevProps, | |
nextProps, | |
prevState, | |
nextState | |
) => { | |
const groupLabel = | |
(componentName && `[${label || "react-logger"} - <${componentName} />]`) || |
import React, { Component } from 'react'; | |
import reactLogger from './reactLogger'; | |
const cars = [ | |
{ id: 1, brand: 'Maruti Suzuki', model: 'Alto', year: '2017' }, | |
{ id: 2, brand: 'Honda', model: 'City', year: '2018' }, | |
{ id: 3, brand: 'Tata', model: 'Bolt', year: '2015' }, | |
{ id: 4, brand: 'Ford', model: 'Classic', year: '2013' }, | |
{ id: 5, brand: 'BMW', model: '5 Series', year: '2018' }, | |
]; |
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
class App extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
posts: [], | |
isLoading: false, | |
offset: 0, |
/** | |
* Deep diff between two object, using lodash | |
* @param {Object} object Object compared | |
* @param {Object} base Object to compare with | |
* @return {Object} Return a new object who represent the diff | |
*/ | |
function difference(object, base) { | |
function changes(object, base) { | |
return _.transform(object, function(result, value, key) { | |
if (!_.isEqual(value, base[key])) { |
if (!toast.isActive(this.toastId)) { | |
const { message } = response.data; | |
this.toastId = toast.success(message); | |
} |
{ | |
"name": "project-name", | |
"description": "Template for static sites", | |
"version": "1.0.0", | |
"homepage": "http://www.project-name.com", | |
"author": { | |
"name": "Adam Buczynski", | |
"url": "http://adambuczynski.com" | |
}, | |
"license": "UNLICENSED", |
// var config = require('./config.js').get(process.env.NODE_ENV); | |
var config = { | |
production: { | |
session: { | |
key: 'the.express.session.id', | |
secret: 'something.super.secret' | |
}, | |
database: 'mongodb://<user>:<pwd>@apollo.modulusmongo.net:27017/db', | |
twitter: { |
// component | |
shouldComponentUpdate(nextProps, nextState) { | |
console.group('react-logger'); | |
console.log('[prevProps]', this.props); | |
console.log('[nextProps]', nextProps); | |
console.log('[prevState]', this.state); | |
console.log('[nextState]', nextState); | |
console.log('[propsChange]', difference(this.props, nextProps)); | |
console.log('[stateChange]', difference(this.state, nextState)); | |
console.groupEnd('react-logger'); |