THT is in early Beta. We welcome contributors & feedback.

Session.addCounter

Session.addCounter(key)

Description

Increment a counter for the given key.

If the key does not yet exist, it is initialized with the value of 1.

The current counter value is returned.

Session.addCounter('numPageHits');
Session.get('numPageHits');  //= 1

// ... in a later request ...

let numPageHits = Session.addCounter('numPageHits');  
    //= 2