From fc4834569acc11946a78c3bdbfdc759d10fab7f8 Mon Sep 17 00:00:00 2001 From: mattak Date: Tue, 27 Dec 2016 23:50:16 +0900 Subject: [PATCH] feat(Example/Todo): refer ActionCreator --- .../Todo/Scripts/Dispatcher/TodoDispatcher.cs | 7 +------ .../Scripts/Dispatcher/TodoFilterButtonDispatcher.cs | 11 ++++++----- .../Todo/Scripts/Dispatcher/TodoToggleDispatcher.cs | 12 +----------- 3 files changed, 8 insertions(+), 22 deletions(-) diff --git a/Assets/Plugins/Unidux/Examples/Todo/Scripts/Dispatcher/TodoDispatcher.cs b/Assets/Plugins/Unidux/Examples/Todo/Scripts/Dispatcher/TodoDispatcher.cs index 47bef77..a30f1d3 100644 --- a/Assets/Plugins/Unidux/Examples/Todo/Scripts/Dispatcher/TodoDispatcher.cs +++ b/Assets/Plugins/Unidux/Examples/Todo/Scripts/Dispatcher/TodoDispatcher.cs @@ -18,12 +18,7 @@ void OnEnable() void Dispatch(string text) { - Unidux.Store.Dispatch(new TodoDuck.Action() - { - ActionType = TodoDuck.ActionType.ADD_TODO, - Todo = new Todo() {Text = text} - }); - + Unidux.Store.Dispatch(TodoDuck.ActionCreator.CreateTodo(text)); this.InputField.text = ""; } } diff --git a/Assets/Plugins/Unidux/Examples/Todo/Scripts/Dispatcher/TodoFilterButtonDispatcher.cs b/Assets/Plugins/Unidux/Examples/Todo/Scripts/Dispatcher/TodoFilterButtonDispatcher.cs index fd7459c..c4a4d8d 100644 --- a/Assets/Plugins/Unidux/Examples/Todo/Scripts/Dispatcher/TodoFilterButtonDispatcher.cs +++ b/Assets/Plugins/Unidux/Examples/Todo/Scripts/Dispatcher/TodoFilterButtonDispatcher.cs @@ -14,12 +14,13 @@ void OnEnable() this.GetComponent