Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Lift の Web サイト ( http://simply.liftweb.net/index-6.3.html#prev ) のチュートリアルに従っていますが、セッションを閉じずにカートの内容を空にする方法がわかりません。
の内容を空Cartの に置き換えることでカートをクリアするクラスに次のメソッドを追加できます。ValueCellVector
Cart
ValueCell
Vector
def removeAllItems() = contents.atomicUpdate(v => Vector.empty)
Regis Jean-Gilles のコメントも機能しますが、atomicUpdateメソッドを使用すると同期が処理されます。
atomicUpdate