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

Side by Side Diff: lib/src/init.dart

Issue 1026153002: add initWebComponents (Closed) Base URL: git@github.com:dart-lang/web-components.git@master
Patch Set: code review updates Created 5 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
« no previous file with comments | « lib/init.dart ('k') | lib/src/mirror_initializer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file.
4 library web_components.src.init;
5
6 import 'dart:async';
7 import 'package:initialize/initialize.dart' show InitializerFilter;
8 import 'package:web_components/web_components.dart';
9 import 'mirror_initializer.dart' as init;
10
11 /// Performs html import aware initialization by crawling all imported documents
12 /// and initializing any script tags which appear in them.
13 ///
14 /// By default, this will run all [HtmlImport] initializers, followed in a 2nd
15 /// phase by all [CustomElement] and [CustomElementProxy] initializers. Then,
16 /// unless [initAll] is [false], it will run all remaining initializers.
17 ///
18 /// If a [typeFilter] or [customFilter] are supplied, only one phase is ran
19 /// with the supplied filters.
20 Future initWebComponents({List<Type> typeFilter, InitializerFilter customFilter,
21 bool initAll: true}) {
22 if (typeFilter != null || customFilter != null) {
23 return init.run(typeFilter: typeFilter, customFilter: customFilter);
24 } else {
25 return init.run(typeFilter: [HtmlImport])
26 .then((_) => init.run(typeFilter: [CustomElement, CustomElementProxy]))
27 .then((_) => initAll ? init.run() : null);
28 }
29 }
OLDNEW
« no previous file with comments | « lib/init.dart ('k') | lib/src/mirror_initializer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698