EN RU
Forum

Methodology

Technology

Toolbox

Libraries

Tutorials

DocumentationJSDocSource

tick

This block provides an object for working with a regularly generated tick event (to implement the polling pattern).

Overview

Object events

Name Description
tick A regularly generated event.

Properties and methods of the object

Name Return type Description
start() - Starts generating tick events if the process hasn't started yet.
stop() - Stops generating tick events if the process hasn't stopped yet.

Block modifiers

Modifier Acceptable values Usage Description
start 'auto' JS Automatically starts generating events

Public block technologies

The block is implemented in:

  • vanilla.js

Description

Object events

tick event

Subscribe to the event to use it to implement the polling pattern.

An event is generated every 50 milliseconds.

Properties and methods of the object

The block is a descendant of the Emitter class in the events block, which allows it to call these classes.

modules.require('tick', function(tick) {

var update = function() { /* ... */ };

tick
    .on('tick', update) // subscribing to the tick event
    .start(); // starting generation of tick events
});

start method

Starts generating tick events if the process hasn't started yet. A tick is generated with an interval of 50 milliseconds after invoking the method.

Doesn't accept arguments.

No return value.

stop method

Stops generating tick events.

Doesn't accept arguments.

No return value.

Block modifiers

start modifier

Acceptable values: 'auto'.

Usage: JS.

Use the block with the start modifier set to auto in order to automatically start generating tick events. The event starts being generated at the time of block initialization.

Instance methods:
start
stop

Module tick

Helpers for polling anything

Instance methods:

start()
description
Starts polling
stop()
description
Stops polling