You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@royale.apache.org by ca...@apache.org on 2020/09/10 16:15:47 UTC

[royale-asjs] branch develop updated: todomvc: update to use collection interfaces in model variables

This is an automated email from the ASF dual-hosted git repository.

carlosrovira pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new d189681  todomvc: update to use collection interfaces in model variables
d189681 is described below

commit d189681064b370cdf8a1b575e517bb521d68705a
Author: Carlos Rovira <ca...@apache.org>
AuthorDate: Thu Sep 10 18:15:30 2020 +0200

    todomvc: update to use collection interfaces in model variables
---
 .../src/main/royale/jewel/todomvc/controllers/TodoController.as   | 5 +++--
 .../src/main/royale/jewel/todomvc/models/TodoModel.as             | 8 +++++---
 .../src/main/royale/jewel/todomvc/controllers/TodoController.as   | 7 ++++---
 .../todomvc/src/main/royale/jewel/todomvc/models/TodoModel.as     | 8 +++++---
 4 files changed, 17 insertions(+), 11 deletions(-)

diff --git a/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc/controllers/TodoController.as b/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc/controllers/TodoController.as
index d4c6229..a0b910a 100644
--- a/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc/controllers/TodoController.as
+++ b/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc/controllers/TodoController.as
@@ -24,6 +24,7 @@ package jewel.todomvc.controllers
 	import jewel.todomvc.vos.TodoVO;
 
 	import org.apache.royale.collections.ArrayList;
+	import org.apache.royale.collections.IArrayList;
 
 	/**
      * The Todo Controller holds all the global actions. The views dispatch events that bubbles and
@@ -199,10 +200,10 @@ package jewel.todomvc.controllers
 				model.listItems = model.allItems;
 			} 
 			else if(model.filterState == TodoModel.ACTIVE_FILTER) {
-				model.listItems = model.activeItems;
+				model.listItems = model.activeItems as IArrayList;
 			}
 			else if(model.filterState == TodoModel.COMPLETED_FILTER) {
-				model.listItems = model.completedItems;
+				model.listItems = model.completedItems as IArrayList;
 			}
 		}
 	}
diff --git a/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc/models/TodoModel.as b/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc/models/TodoModel.as
index 80d8850..dd964e6 100644
--- a/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc/models/TodoModel.as
+++ b/examples/crux/todomvc-jewel-crux/src/main/royale/jewel/todomvc/models/TodoModel.as
@@ -22,6 +22,8 @@ package jewel.todomvc.models
 
 	import org.apache.royale.collections.ArrayList;
 	import org.apache.royale.collections.ArrayListView;
+	import org.apache.royale.collections.IArrayList;
+	import org.apache.royale.collections.IArrayListView;
 	import org.apache.royale.events.EventDispatcher;
 
     /**
@@ -41,7 +43,7 @@ package jewel.todomvc.models
         /**
          * the list of items binded to the todo list component
          */
-        public var listItems:Object;
+        public var listItems:IArrayList;
         
         /**
          * the real list with all items
@@ -51,12 +53,12 @@ package jewel.todomvc.models
         /**
          * the filtered list with active items
          */
-        public var activeItems:ArrayListView;
+        public var activeItems:IArrayListView;
         
         /**
          * the filtered list with completed items
          */
-        public var completedItems:ArrayListView;
+        public var completedItems:IArrayListView;
 
         /**
          *  Set up the filtered collections for later use
diff --git a/examples/jewel/todomvc/src/main/royale/jewel/todomvc/controllers/TodoController.as b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/controllers/TodoController.as
index f4b5db3..dcc412f 100644
--- a/examples/jewel/todomvc/src/main/royale/jewel/todomvc/controllers/TodoController.as
+++ b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/controllers/TodoController.as
@@ -23,10 +23,11 @@ package jewel.todomvc.controllers
 	import jewel.todomvc.vos.TodoVO;
 
 	import org.apache.royale.collections.ArrayList;
+	import org.apache.royale.collections.IArrayList;
+	import org.apache.royale.core.Bead;
 	import org.apache.royale.core.IBeadController;
 	import org.apache.royale.core.IBeadModel;
 	import org.apache.royale.core.IStrand;
-	import org.apache.royale.core.Bead;
 
 	/**
      * The Todo Controller holds all the global actions. The views dispatch events that bubbles and
@@ -209,10 +210,10 @@ package jewel.todomvc.controllers
 				model.listItems = model.allItems;
 			} 
 			else if(model.filterState == TodoModel.ACTIVE_FILTER) {
-				model.listItems = model.activeItems;
+				model.listItems = model.activeItems as IArrayList;
 			}
 			else if(model.filterState == TodoModel.COMPLETED_FILTER) {
-				model.listItems = model.completedItems;
+				model.listItems = model.completedItems as IArrayList;
 			}
 		}
 	}
diff --git a/examples/jewel/todomvc/src/main/royale/jewel/todomvc/models/TodoModel.as b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/models/TodoModel.as
index 5b0c4ae..b00778d 100644
--- a/examples/jewel/todomvc/src/main/royale/jewel/todomvc/models/TodoModel.as
+++ b/examples/jewel/todomvc/src/main/royale/jewel/todomvc/models/TodoModel.as
@@ -22,6 +22,8 @@ package jewel.todomvc.models
 
 	import org.apache.royale.collections.ArrayList;
 	import org.apache.royale.collections.ArrayListView;
+	import org.apache.royale.collections.IArrayList;
+	import org.apache.royale.collections.IArrayListView;
 	import org.apache.royale.core.IBeadModel;
 	import org.apache.royale.core.IStrand;
 	import org.apache.royale.events.EventDispatcher;
@@ -82,7 +84,7 @@ package jewel.todomvc.models
         /**
          * the list of items binded to the todo list component
          */
-        public var listItems:Object;
+        public var listItems:IArrayList;
         
         /**
          * the real list with all items
@@ -92,12 +94,12 @@ package jewel.todomvc.models
         /**
          * the filtered list with active items
          */
-        public var activeItems:ArrayListView;
+        public var activeItems:IArrayListView;
         
         /**
          * the filtered list with completed items
          */
-        public var completedItems:ArrayListView;
+        public var completedItems:IArrayListView;
 
         /**
          *  Set up the filtered collections for later use