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

Session.addToList

Session.addToList(key, value)

Description

Append the value to a list at the given key.

If the key is not yet initialized, it will first be set to an empty list [].

Session.addToList('shoppingCartItems', 'Blue Hat');
Session.addToList('shoppingCartItems', 'Green Shirt');

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

Session.get('shoppingCartItems');
//= [ 'Blue Hat', 'Green Shirt' ]