   # => ['1', '2', '4', '5']
   remove: (itemId) ->
     @values = _.without @values, itemId.toString()
-    this.save()
-
-  save: -> @storage.setItem @name, @values.join(',')
-  reset: -> @values = []; this.save()
+    @save()
+
+  save: ->
+    @storage.setItem @name, @values.join(',')
+
+  reset: ->
+    @values = []
+    @storage.removeItem @name
 
 # Use as wrapper for 'Backbone.Collection'
 class Offline.Collection

  #
  # @storage.sync.pull()
  pull: (options = {}) ->
    this.ajax 'read', @collection.items, success: (response, status, xhr) =>
      @collection.destroyDiff(response)
      this.pullItem(item) for item in response
      options.success() if options.success

  pullItem: (item) ->
    local = @collection.get(item.id)
    if local
      this.updateItem(item, local)
    else
      this.createItem(item)

  createItem: (item) ->
    unless _.include(@storage.destroyIds.values, item.id.toString())

#    May be freely distributed according to MIT license.

window.Offline =
  VERSION: '0.4.0.alfa'

  # This is a method for CRUD operations with localStorage.
  # Delegates to 'Offline.Storage' and works as ‘Backbone.sync’ alternative
