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

Unified Diff: sky/examples/city-list/city-data-service.sky

Issue 980323003: Clean up examples directory (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/examples/README.md ('k') | sky/examples/city-list/city-list.sky » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/examples/city-list/city-data-service.sky
diff --git a/sky/examples/city-list/city-data-service.sky b/sky/examples/city-list/city-data-service.sky
deleted file mode 100644
index c7ddff6d25ffb6461574abe7d1c0c790bb4208f2..0000000000000000000000000000000000000000
--- a/sky/examples/city-list/city-data-service.sky
+++ /dev/null
@@ -1,46 +0,0 @@
-<!--
-// Copyright 2014 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
--->
-<import src="../data/cities.sky" as="cities" />
-<script>
-function CityDataService(cities) {
- this.cities = cities;
-
- // sort by state, city name.
- this.cities.sort(function(a, b) {
- if (a.state != b.state) {
- return a.state < b.state ? -1 : 1;
- }
-
- return a.name < b.name ? -1 : 1;
- });
-}
-
-CityDataService.prototype.get = function(index, count) {
- var self = this;
-
- return new Promise(function(fulfill) {
- var result = [];
- while (count-- > 0) {
- while (index < 0) {
- index += self.cities.length;
- }
- if (index >= self.cities.length)
- index = index % self.cities.length;
-
- result.push(self.cities[index]);
- index++;
- }
-
- fulfill(result);
- });
-}
-
-module.exports = {
- service: new Promise(function(fulfill) {
- fulfill(new CityDataService(cities));
- })
-};
-</script>
« no previous file with comments | « sky/examples/README.md ('k') | sky/examples/city-list/city-list.sky » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698