@marko-tags/effect
Add and remove event subscriptions within your template.
Installation
npm install @marko-tags/effect
Example
<effect(() => {
if (!state.map) {
state.map = new google.maps.Map(component.getEl('map'));
}
return () => {
state.map = null;
}
})/>
<div key="map"></div>
API
<effect
argument ():cleanup
/>