Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Side by Side Diff: chrome/browser/resources/md_bookmarks/bookmarks_store.js

Issue 2733463002: MD Bookmarks: Add basic page features to new data-flow system (Closed)
Patch Set: calamity@ review Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview A singleton datastore for the Bookmarks page. Page state is 6 * @fileoverview A singleton datastore for the Bookmarks page. Page state is
7 * publicly readable, but can only be modified by dispatching an Action to 7 * publicly readable, but can only be modified by dispatching an Action to
8 * the store. 8 * the store.
9 */ 9 */
10 10
11 cr.define('bookmarks', function() { 11 cr.define('bookmarks', function() {
12 /** @constructor */ 12 /** @constructor */
13 function Store() { 13 function Store() {
14 /** @type {!BookmarksPageState} */ 14 /** @type {!BookmarksPageState} */
15 this.data_ = {}; 15 this.data_ = bookmarks.util.createEmptyState();
16 /** @type {boolean} */ 16 /** @type {boolean} */
17 this.initialized_ = false; 17 this.initialized_ = false;
18 /** @type {!Array<!StoreObserver>} */ 18 /** @type {!Array<!StoreObserver>} */
19 this.observers_ = []; 19 this.observers_ = [];
20 } 20 }
21 21
22 Store.prototype = { 22 Store.prototype = {
23 /** 23 /**
24 * @param {!BookmarksPageState} initialState 24 * @param {!BookmarksPageState} initialState
25 */ 25 */
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 }); 73 });
74 }, 74 },
75 }; 75 };
76 76
77 cr.addSingletonGetter(Store); 77 cr.addSingletonGetter(Store);
78 78
79 return { 79 return {
80 Store: Store, 80 Store: Store,
81 }; 81 };
82 }); 82 });
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698