Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scu-inspector

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scu-inspector

Displaying props changes of shouldComponentUpdate

  • 0.2.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

scu-inspector

npm npm Build Status

Please, write issue or PR, if have any feedback.

It does not display after filtered by false in SCU. So you can just check what props were not apply by filtered.

Synopsis

I used to display by using console.log to check prop changes in Console tab. But it was hard to recognize what was changed or not. So, I implemented module to check as table view in Console tab to avoid annoying.

Purpose is displaying props changes of shouldComponentUpdate(React). It is designed to use by single component by using decorator. If you want to apply every React components by using just once, use 'why-did-you-update'.

Installation

npm install --save scu-inspector

Screenshot

Screenshot

Usage

Babel

"plugins": [
  "transform-decorators-legacy"
]

Javascript (React)

import scuInspector from 'scu-inspector'

// with options
@scuInspector({
  // [optional] display props changes
  mode: 'changed', // all(default), changed, none

  // [optional] default display name will be using component name
  // but if you want to use unique string to recognize among components
  uniqueKey: 'position', // key name of props

  // [optional] it displays in Development Tool as console.table
  // default is false
  isCollapsed: true,

  // [optional]
  // logs off in production by default
  // but you can turn it off or not manually
  // default is true
  debug: false,

  // [optional] show specific keys of props
  // ignoring exclude
  include: ['name', 'homepage'],

  // [optional] hide specific keys of props
  exclude: ['age', 'address', 'location']
})
shouldComponentUpdate (nextProps) {
  ...
}

// without options
@scuInspector()
shouldComponentUpdate (nextProps) {
  ...
}

License

MIT

Keywords

FAQs

Package last updated on 27 Feb 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc