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

TypeScript typesafe-actions.createStandardAction函数代码示例

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

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



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

示例1: createStandardAction

import { createStandardAction, ActionType } from 'typesafe-actions';
import { Subtitle } from '../../models/subtitle';

const LOAD_DATA = 'jamak/subtitle/LOAD_DATA';
const NEW_DATA = 'jamak/subtitle/NEW_DATA';
const SAVE_DATA = 'jamak/subtitle/SAVE_DATA';
const SET_SELECTION = 'jamak/subtitle/SET_SELECTION';
const APPEND_SELECTION = 'jamak/subtitle/APPEND_SELECTION';
const POP_SELECTION = 'jamak/subtitle/POP_SELECTION';
const ADD_SUBTITLE = 'jamak/subtitle/ADD_SUBTITLE';
const UPDATE_SUBTITLE = 'jamak/subtitle/UPDATE_SUBTITLE';
const DELETE_SUBTITLE = 'jamak/subtitle/DELETE_SUBTITLE';
const SORT_SUBTITLE = 'jamak/subtitle/SORT_SUBTITLE';

export const actions = {
  loadData: createStandardAction(LOAD_DATA)<{
    filepath: string;
    data: Subtitle[];
  }>(),
  newData: createStandardAction(NEW_DATA)<void>(),
  saveData: createStandardAction(SAVE_DATA)<{
    filepath: string;
    data: Subtitle[];
  }>(),
  setSelection: createStandardAction(SET_SELECTION)<Set<number>>(),
  appendSelection: createStandardAction(APPEND_SELECTION)<Set<number>>(),
  popSelection: createStandardAction(POP_SELECTION)<Set<number>>(),
  addSubtitle: createStandardAction(ADD_SUBTITLE)<Subtitle>(),
  updateSubtitle: createStandardAction(UPDATE_SUBTITLE)<{
    index: number;
    subtitle: Subtitle;
开发者ID:Heeryong-Kang,项目名称:jamak,代码行数:31,代码来源:subtitle.ts


示例2: createStandardAction

import { DestinyAccount } from './destiny-account.service';
import { createStandardAction } from 'typesafe-actions';

export const accountsLoaded = createStandardAction('accounts/ACCOUNTS_LOADED')<DestinyAccount[]>();
export const setCurrentAccount = createStandardAction('accounts/SET_CURRENT_ACCOUNT')<
  DestinyAccount
>();
开发者ID:bhollis,项目名称:DIM,代码行数:7,代码来源:actions.ts


示例3: createStandardAction

import { createStandardAction, ActionType } from 'typesafe-actions';

const SET_MULTIPLE = 'jamak/timeline/SET_MULTIPLE';

export const actions = {
  setMultiple: createStandardAction(SET_MULTIPLE)<number>(),
};

export interface TimelineState {
  readonly multiple: number;
}

export type TimelineAction = ActionType<typeof actions>;

const initialState: TimelineState = {
  multiple: 1,
};

export default function reducer(
  state: TimelineState = initialState,
  action: TimelineAction,
): TimelineState {
  switch (action.type) {
    case SET_MULTIPLE:
      return {
        ...state,
        multiple: action.payload,
      };
    default:
      return state;
  }
开发者ID:Heeryong-Kang,项目名称:jamak,代码行数:31,代码来源:timeline.ts


示例4: createStandardAction

import { createStandardAction, ActionType } from 'typesafe-actions';

// Actions
const SET_SUBTITLE_READY = 'jamak/welcome/SUBTITLE_READY';
const SET_VIDEO_READY = 'jamak/welcome/VIDEO_READY';

// Action Creators
export const actions = {
  setSubtitleReady: createStandardAction(SET_SUBTITLE_READY)<boolean>(),
  setVideoReady: createStandardAction(SET_VIDEO_READY)<boolean>(),
};

export interface WelcomeState {
  readonly subtitleReady: boolean;
  readonly videoReady: boolean;
}

export type WelcomeAction = ActionType<typeof actions>;

const initialState: WelcomeState = {
  subtitleReady: false,
  videoReady: false,
};

// Reducers
export default function reducer(
  state: WelcomeState = initialState,
  action: WelcomeAction,
): WelcomeState {
  switch (action.type) {
    case SET_SUBTITLE_READY:
开发者ID:Heeryong-Kang,项目名称:jamak,代码行数:31,代码来源:welcome.ts


示例5: createStandardAction

import { createAsyncAction, createStandardAction } from 'typesafe-actions'
import { Direction } from '../../types/enums'
import { APIOrder, FormUpdate, OrderMatch, OrderType } from '../../types/interfaces'

export const tradeFormChange = createStandardAction('TRADE_FORM_CHANGE')<FormUpdate<OrderType>>()
export const placeTradeAction = createAsyncAction(
  'PLACE_TRADE_REQUEST',
  'PLACE_TRADE_SUCCESS',
  'PLACE_TRADE_FAILURE',
)<APIOrder, OrderMatch[], Error>()
开发者ID:Carl-Foster,项目名称:exchange-app,代码行数:10,代码来源:trade.ts


示例6: createStandardAction

import { ActionType, createStandardAction } from "typesafe-actions";
import { Tab } from "../components/NavBar";

export const actions = {
  setChosenDeckName: createStandardAction("SET_CHOSEN_DECK_NAME")<string>(),
  setDecks: createStandardAction("SET_DECKS")<any[]>(),
  setDefaultDeckName: createStandardAction("SET_DEFAULT_DECK_NAME")<string>(),
  setMoreDeckName: createStandardAction("SET_MORE_DECK_NAME")<string>(),
  setShowGoogleImageModal: createStandardAction("SET_SHOW_GOOGLE_IMAGE_MODAL")<boolean>(),
};

export type RootAction = ActionType<typeof actions>;
开发者ID:searene,项目名称:lantastic,代码行数:12,代码来源:index.ts


示例7: createStandardAction

import { createStandardAction } from 'typesafe-actions';
import { InventoryCuratedRoll } from './curatedRollService';

export const updateCurations = createStandardAction('curations/UPDATE')<{
  curationEnabled: boolean;
  inventoryCuratedRolls: InventoryCuratedRoll[];
}>();
开发者ID:w1cked,项目名称:DIM,代码行数:7,代码来源:actions.ts



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
TypeScript typesafe-actions.getType函数代码示例发布时间:2022-05-25
下一篇:
TypeScript typesafe-actions.createReducer函数代码示例发布时间: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