Mailspring/internal_packages/file-list/lib/file-list-store.coffee
Evan Morikawa 4619871e8d refactor(utils): switch to regular underscore
Summary:
Fixes: T1334

remove final InboxApp references

move out all underscore-plus methods

Mass find and replace of underscore-plus

sed -i '' -- 's/underscore-plus/underscore/g' **/*.coffee
sed -i '' -- 's/underscore-plus/underscore/g' **/*.cjsx

Test Plan: edgehill --test

Reviewers: bengotow

Reviewed By: bengotow

Differential Revision: https://phab.nylas.com/D1534
2015-05-19 16:06:59 -07:00

20 lines
513 B
CoffeeScript

Reflux = require 'reflux'
_ = require 'underscore'
{File,
DatabaseStore,
DatabaseView} = require 'nylas-exports'
module.exports =
FileListStore = Reflux.createStore
init: ->
@listenTo DatabaseStore, @_onDataChanged
@_view = new DatabaseView(File, matchers: [File.attributes.filename.not('')])
@listenTo @_view, => @trigger({})
view: ->
@_view
_onDataChanged: (change) ->
return unless change.objectClass is File.name
@_view.invalidate({shallow: true, changed: change.objects})