nanocomponent
Advanced tools
Comparing version 6.1.0 to 6.2.0
@@ -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 @@ |
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
232268
14
448
391