1.1.2 • Published 9 months ago
yet_another_d_render v1.1.2
A lightweight hotwired-compatible lib with directive programming in HTML
Quick start example:
<div d-state="{ count: 0, displayed: true }">
<!-- the <p> below initially shows 0 which is the value of the count var we set in d-state -->
<p d-text="count"></p>
<div d-show="displayed">This div will be shown while the link below was clicked odd number of times.</div>
<a href="javascript:void(0)" d-click="{ count: count + 1, displayed: !displayed }">Clicking on this link increases the count, and toggles the div display.</a>
</div>
How it works:
In the above example, DRender found the div who has the 'd-state', and created a component instance with state (which from the 'd-state' attributes'). The component compiled the directive (such as d-text, d-show) to hooks. All the hooks will be executed each time the state of component gets updated.
Usage
import DRender from 'd_render'
document.addEventListener('DOMContentLoaded',() => DRender.run())
//Or
//document.addEventListener('tubro:load',() => DRender.run())
1.1.1
10 months ago
1.1.0
10 months ago
1.1.2
9 months ago
1.0.27
12 months ago
1.0.26
1 year ago
1.0.25
1 year ago
1.0.24
1 year ago
1.0.19
2 years ago
1.0.22
2 years ago
1.0.21
2 years ago
1.0.20
2 years ago
1.0.23
2 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.16
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago