# j-OneTime

> This component executes a method only once and it waits for expiration.

Framework: jcomponent20
Product: jComponent 20 (jcomponent@20)
Language: en
Content-SHA256: 46b792a460652756486b7bf8fdce0de9f2b5e4ee8901f75b9b6c81008d660709
Snapshot: c0700e321579725c5cf4f5ace1ad7d2866d1b4f93c24a63c0b41b6b7998e976c
Sources: components@910ed1a86f6e72b4f031d3ad0dc7844f9fc5cb8e
Review: not-recorded

This component executes a method only once and it waits for expiration.

- Download templates: https://github.com/totaljs/templates

__Configuration__:

- __required__ `exec {String}` a path to the method that will be executed
- `expire {String}` expiration, default `1 year`
- `delay {Number}` a delay for executing method in milliseconds, default: `1000` ms

Use it with `<ui-component name="onetime">`. When the component is not loaded yet, jComponent downloads it on first use from the address in `DEF.fallback` (the Componentator CDN by default). Author: Peter Širka. Source: the Componentator components repository, MIT license.

```html example.html
<ui-component name="onetime" config="exec:onetimealert;expire:1 month"></ui-component>

<script>

	function onetimealert() {
		alert('After a month, this message will appear again.');
	}

</script>
```
