1.0.0-beta.29 • Published 3 years ago
diffhtml-middleware-inline-transitions v1.0.0-beta.29
<±/> diffHTML Inline Transitions Middleware
Stable Version: 1.0.0-beta.29
Tiny module to support binding/unbinding declarative diffHTML transition hooks.
Installation
npm install diffhtml-middleware-inline-transitions
Use
import { use } from 'diffhtml';
import inlineTransitions from 'diffhtml-middleware-inline-transitions';
use(inlineTransitions());
Example
Apply to an element by passing the function to the associated state name:
import $ from 'jquery';
import { innerHTML, html, use } from 'diffhtml';
import inlineTransitions from 'diffhtml-middleware-inline-transitions';
// Enable the monitoring of attributes for changes.
use(inlineTransitions());
// Use jQuery to return a promise and fade in the body and paragraph.
function fadeIn(body, domNode) {
return $(domNode).fadeOut(0).fadeIn(1000).promise();
}
innerHTML(document.body, html`<body onattached=${fadeIn}>
<p>Watch me fade in slowly!</p>
</body>`);
Full events and args list:
Event Name | Args |
---|---|
onattached | (eventTarget, domNode) |
ondetached | (eventTarget, domNode) |
onreplaced | (eventTarget, oldNode, newNode) |
onattributechanged | (eventTarget, oldNode, attributeName, oldValue, newValue) |
ontextchanged | (eventTarget, oldNode, oldValue, newValue) |
1.0.0-beta.29
3 years ago
1.0.0-beta.28
3 years ago
1.0.0-beta.26
3 years ago
1.0.0-beta.27
3 years ago
1.0.0-beta.24
3 years ago
1.0.0-beta.25
3 years ago
1.0.0-beta.22
4 years ago
1.0.0-beta.23
3 years ago
1.0.0-beta.21
4 years ago
1.0.0-beta.20
4 years ago
1.0.0-beta.19
4 years ago
1.0.0-beta.18
5 years ago
1.0.0-beta.17
5 years ago
1.0.0-beta.16
5 years ago
1.0.0-beta.15
5 years ago
1.0.0-beta.14
5 years ago
1.0.0-beta.13
5 years ago
1.0.0-beta.12
5 years ago
1.0.0-beta.11
5 years ago
1.0.0-beta.9
8 years ago
1.0.0-beta.8
8 years ago
1.0.0-beta.7
8 years ago
1.0.0-beta.6
8 years ago
1.0.0-beta.5
8 years ago
1.0.0-beta.4
8 years ago
1.0.0-beta.3
8 years ago
1.0.0-beta.2
8 years ago
1.0.0-beta.1
8 years ago
1.0.0-beta
8 years ago