Ejemplo n.º 1
0
        public override State Reduce(State state, DvaAction action)
        {
            switch (action.Type)
            {
            case "setPackages":
                state.PackageDatas = action.Payload as List <PackageData>;
                break;
            }

            return(state);
        }
Ejemplo n.º 2
0
        public override State Reduce(State state, DvaAction action)
        {
            switch (action.Type)
            {
            case "setInLoginView":
                state.InLoginView = (bool)action.Payload;
                break;

            case "setLogined":
                state.Logined = (bool)action.Payload;
                break;
            }

            return(state);
        }
Ejemplo n.º 3
0
        public override CounterState Reduce(CounterState state, DvaAction action)
        {
            switch (action.Type)
            {
            case "increase":
                state.Count++;
                break;

            case "decrease":
                state.Count--;
                break;
            }

            return(state);
        }
Ejemplo n.º 4
0
        public override State Reduce(State state, DvaAction action)
        {
            if (action.Type == "setProgress")
            {
                state.Progress = (byte)action.Payload;
            }
            else if (action.Type == "setNotice")
            {
                state.NoticeMessage = (string)action.Payload;
            }
            else if (action.Type == "setResult")
            {
                state.UpdateResult = (string)action.Payload;
            }

            return(state);
        }