コード例 #1
0
        /// <summary>
        /// 创建store
        /// 每次请求都是独立的Store
        /// </summary>
        /// <param name="state"></param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        static public StoreWrapper CreateStore <A, B>(AReducers <A> r1, AReducers <B> r2) where A : AStateBase, new() where B : AStateBase, new()
        {
            //构造store
            var s1 = CreateStore <A>(r1);
            var s2 = CreateStore <B>(r2);

            var sw = new StoreWrapper(s1, s2);

            return(sw);
        }
コード例 #2
0
        /// <summary>
        /// 创建store
        /// 每次请求都是独立的Store
        /// </summary>
        /// <param name="state"></param>
        /// <typeparam name="T"></typeparam>
        /// <returns></returns>
        static public StoreWrapper CreateStore <A, B, C, D>(AReducers <A> r1, AReducers <B> r2, AReducers <C> r3, AReducers <D> r4) where A : AStateBase, new() where B : AStateBase, new() where C : AStateBase, new() where D : AStateBase, new()
        {
            //构造store
            var s1 = CreateStore <A>(r1);
            var s2 = CreateStore <B>(r2);
            var s3 = CreateStore <C>(r3);
            var s4 = CreateStore <D>(r4);

            var sw = new StoreWrapper(s1, s2, s3, s4);

            return(sw);
        }