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

nanocomponent

Package Overview
Dependencies
Maintainers
7
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nanocomponent - npm Package Compare versions

Comparing version 6.1.0 to 6.2.0

lifecycle.jpg

8

CHANGELOG.md

@@ -5,2 +5,10 @@ # nanocomponent Change Log

## 6.2.0 - 2017-08-18
- **Added**: `afterreorder` event which is called after your component is remounted on sibbling reorders.
## 6.1.0 - 2017-08-14
- **Added**: [nanotiming](https://github.com/choojs/nanotiming) timings. You can name component instances and it will emit timing information. See [nanocomponent/pull/47](https://github.com/choojs/nanocomponent/pull/47)
## 6.0.1 - 2017-08-09

@@ -7,0 +15,0 @@

7

index.js

@@ -58,3 +58,3 @@ var document = require('global/document')

if (this.beforerender) this.beforerender(el)
if (this.load || this.unload) {
if (this.load || this.unload || this.afterrreorder) {
onload(el, self._handleLoad, self._handleUnload, self)

@@ -107,3 +107,6 @@ }

var self = this
if (this._loaded) return // Debounce child-reorders
if (this._loaded) {
if (this.afterreorder) window.requestAnimationFrame(function () { self.afterreorder(el) })
return // Debounce child-reorders
}
this._loaded = true

@@ -110,0 +113,0 @@ if (this.load) window.requestAnimationFrame(function () { self.load(el) })

{
"name": "nanocomponent",
"version": "6.1.0",
"version": "6.2.0",
"description": "Native DOM components that pair nicely with DOM diffing algorithms",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -232,2 +232,9 @@ # nanocomponent [![stability][0]][1]

## FAQ
### What order do lifecycle events run in?
<figure>
<img src="lifecycle.jpg" alt="Lifecycle diagram">
<figcaption>Note: aftercreate should actually say afterupdate. Shoutout to <a href="https://github.com/lrlna">@lrlna</a> for the excellent diagram.</figcaption>
</figure>
### Where does this run?

@@ -331,2 +338,6 @@ Nanocomponent was written to work well with [choo][choo], but it also works well

### `Nanocomponent.prototype.afterreorder(el)`
Called after a component is re-ordered. This method is rarely needed, but is handy when you have a component
that is sensitive to temorary removals from the DOM, such as externally controlled iframes or embeds (e.g. embedded tweets).
## Installation

@@ -333,0 +344,0 @@ ```sh

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