Version: v0.7.0 - Beta.  We welcome contributors & feedback.

Session.addToList

Session.addToList($key, $value) -> list

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 [].

Returns the current list with the added item.

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

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

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