shallow-compare

WebJar for shallow-compare

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

shallow-compare
Последняя версия

Последняя версия

1.2.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

shallow-compare
WebJar for shallow-compare
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/tkh44/shallow-compare

Скачать shallow-compare

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/shallow-compare/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>shallow-compare</artifactId>
    <version>1.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/shallow-compare/
implementation 'org.webjars.npm:shallow-compare:1.2.2'
// https://jarcasting.com/artifacts/org.webjars.npm/shallow-compare/
implementation ("org.webjars.npm:shallow-compare:1.2.2")
'org.webjars.npm:shallow-compare:jar:1.2.2'
<dependency org="org.webjars.npm" name="shallow-compare" rev="1.2.2">
  <artifact name="shallow-compare" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='shallow-compare', version='1.2.2')
)
libraryDependencies += "org.webjars.npm" % "shallow-compare" % "1.2.2"
[org.webjars.npm/shallow-compare "1.2.2"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

shallow-compare

npm version

Stand alone shallowCompare for use in libraries that support shouldComponentUpdate

API

shallowCompare(instance, nextProps, nextState)

  • instance (component instance) - the component's instance (this)
  • nextProps (object) - the next props
  • nextState (object) - the next state

Example

class Foo extends Component {
  constructor (props) {
    super(props);
    this.state = { color: 'blue' }
  }

  shouldComponentUpdate (nextProps, nextState) {
    return shallowCompare(this, nextProps, nextState)
  }

  render () {
    return (
      <div>{this.state.color}</div>
    )
  }
}

Версии библиотеки

Версия
1.2.2