• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

TypeScript typed-immutable-record.makeTypedFactory函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了TypeScript中typed-immutable-record.makeTypedFactory函数的典型用法代码示例。如果您正苦于以下问题:TypeScript makeTypedFactory函数的具体用法?TypeScript makeTypedFactory怎么用?TypeScript makeTypedFactory使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了makeTypedFactory函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。

示例1: fromConfig

export function fromConfig(configSet: IFeatureToggleConfigSet) {
  let justTheValues = {};
  for (let prop in configSet) {
    justTheValues[prop] = configSet[prop].setting;
  }
  return makeTypedFactory<IToggle, IToggleRecord>(justTheValues)();
}
开发者ID:kokokenada,项目名称:common-app,代码行数:7,代码来源:feature-toggle-initial-state.ts


示例2: fromJS

import { makeTypedFactory } from 'typed-immutable-record';
import { fromJS } from 'immutable';

import {
  IProfileRecord,
  IProfile,
} from './profile.types';

export const ProfileFactory = makeTypedFactory<IProfile, IProfileRecord>({
  user: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    item: {},
  }),

  updateUser: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
  }),
});

export const INITIAL_STATE = ProfileFactory();
开发者ID:rtbm,项目名称:ng2-quottr,代码行数:26,代码来源:profile.initial-state.ts


示例3: function

  IObjection,
  IObjectionRecord,
  IRebuttal,
  IRebuttalRecord
} from './list.types';
import { makeTypedFactory } from 'typed-immutable-record';
import { Map, Record, List } from 'immutable';

export const RebuttalFactory = makeTypedFactory<IRebuttal, IRebuttalRecord>({
  id: null,
  shortName: '',
  longName: '',
  link: '',
  comments: '',
  editing: false,
  original: null,
  isTouched: function() {
    return this.original && (this.original.shortName !== this.shortName ||
      this.original.longName !== this.longName ||
      this.original.link !== this.link ||
      (this.original.comments || '') !== (this.comments || ''));
  }
});

export const NewRebuttalFactory = makeTypedFactory<IRebuttal, IRebuttalRecord>({
  id: null,
  shortName: '',
  longName: '',
  link: '',
  comments: '',
  editing: true,
开发者ID:dancancro,项目名称:rangle-started,代码行数:31,代码来源:list.initial-state.ts


示例4: gamePlayReducer

  GamePlayAction, GamePlayActionType, VisibilityType,
  GamePlayActionInterface
} from './action.class';
import {DealLocation, DealSequence, GameConfig} from './game-config.class';
import {Card} from'./card.class';
import {Hand} from './hand.class';
import {Deck} from './deck.class';
import {IPayloadAction} from 'redux-package';
import {GamePlayFunctions} from "./game-play.functions";
import {IGamePlayState} from './game-play-state';

export const GamePlayFactory = makeTypedFactory<IGamePlayState, IGamePlayRecord>({
  gameId: '',
  hands: List<Hand>(),
  tableFaceDown: List<Card>(),
  tablePile: List<Card>(),
  actions: OrderedMap<string, GamePlayAction>(),
  currentGameConfig: GameConfig.getDefaultConfig(),
  undoneIds: List<string>(),
  idCounter:0
});

export const INITIAL_STATE_GAME_PLAY = GamePlayFactory();

export function gamePlayReducer(oldState: IGamePlayRecord = INITIAL_STATE_GAME_PLAY,
                                action: IPayloadAction) {

  if (!GamePlayActions.isGamePlayAction(action.type))
    return oldState;

  let payload: IGamePlayActionPayload = action.payload;
  if (!payload)
开发者ID:kokokenada,项目名称:for-real-cards,代码行数:32,代码来源:game-play.reducer.ts


示例5: UserFactory

import {
  ISessionRecord,
  ISession,
  IUser,
  IUserRecord,
} from './session.types';
import { makeTypedFactory } from 'typed-immutable-record';


export const UserFactory = makeTypedFactory<IUser, IUserRecord>({
  firstName: null,
  lastName: null
});

export const INITIAL_USER_STATE = UserFactory();

export const SessionFactory = makeTypedFactory<ISession, ISessionRecord>({
  token: null,
  user: INITIAL_USER_STATE,
  hasError: false,
  isLoading: false,
});

export const INITIAL_STATE = SessionFactory();
开发者ID:alexeigo,项目名称:angular2-redux-starter,代码行数:24,代码来源:session.initial-state.ts


示例6: fromJS

export const QuotesFactory = makeTypedFactory<IQuotes, IQuotesRecord>({
  quotes: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    items: [],
  }),

  saveQuote: fromJS({
    isModalVisible: false,
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    item: {},
  }),

  updateQuote: fromJS({
    isModalVisible: false,
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    item: {},
  }),

  removeQuote: fromJS({
    isConfirmVisible: false,
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    item: {},
  }),

  recommendQuote: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    item: {},
  }),

  unrecommendQuote: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    item: {},
  }),
});
开发者ID:rtbm,项目名称:ng2-quottr,代码行数:52,代码来源:quotes.initial-state.ts


示例7: ToggleFactory

import {
  IToggleRecord,
  IToggle, IFeatureToggleConfigSet,
} from './feature-toggle-types';
import { makeTypedFactory } from 'typed-immutable-record';

const defaultToggle = {};

export const ToggleFactory = makeTypedFactory<IToggle, IToggleRecord>(
  defaultToggle
);

export const INITIAL_STATE = ToggleFactory();

export function fromConfig(configSet: IFeatureToggleConfigSet) {
  let justTheValues = {};
  for (let prop in configSet) {
    justTheValues[prop] = configSet[prop].setting;
  }
  return makeTypedFactory<IToggle, IToggleRecord>(justTheValues)();
}
开发者ID:kokokenada,项目名称:common-app,代码行数:21,代码来源:feature-toggle-initial-state.ts


示例8: ExerciseFactory

import {
  IExerciseRecord,
  IExercise,
} from './exercise.types';
import { makeTypedFactory } from 'typed-immutable-record';

export const ExerciseFactory = makeTypedFactory<IExercise, IExerciseRecord>({
  id: null,
  name: null,
  bodypart: null
});

export const INITIAL_STATE = ExerciseFactory();
开发者ID:rawkamatic,项目名称:workoutbuddy,代码行数:13,代码来源:exercise.initial-state.ts


示例9: fromJS

  IUser,
} from './user.types';

export const UserFactory = makeTypedFactory<IUser, IUserRecord>({
  id_token: '',
  user: fromJS({}),

  signup: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
  }),

  signin: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
  }),

  resetPassword: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
  }),
});

export const INITIAL_STATE = UserFactory();
开发者ID:rtbm,项目名称:ng2-quottr,代码行数:30,代码来源:user.initial-state.ts


示例10: fromJS

  IUsers,
} from './users.types';

export const UsersFactory = makeTypedFactory<IUsers, IUsersRecord>({
  users: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    items: [],
  }),

  follow: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    item: {},
  }),

  unfollow: fromJS({
    isPending: false,
    isSuccess: false,
    isError: false,
    errorCode: 0,
    item: {},
  }),
});

export const INITIAL_STATE = UsersFactory();
开发者ID:rtbm,项目名称:ng2-quottr,代码行数:30,代码来源:users.initial-state.ts



注:本文中的typed-immutable-record.makeTypedFactory函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
TypeScript typed-immutable-record.recordify函数代码示例发布时间:2022-05-25
下一篇:
TypeScript typed-dom.once函数代码示例发布时间:2022-05-25
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap