本文整理汇总了TypeScript中typesafe-actions.createAsyncAction函数的典型用法代码示例。如果您正苦于以下问题:TypeScript createAsyncAction函数的具体用法?TypeScript createAsyncAction怎么用?TypeScript createAsyncAction使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了createAsyncAction函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: createAsyncAction
import { createAsyncAction } from 'typesafe-actions';
import webpack from 'webpack';
export const webpackBuild = createAsyncAction(
'WEBPACK_BUILD_STARTED',
'WEBPACK_BUILD_COMPLETED',
'WEBPACK_BUILD_FAILED'
)<void, webpack.Stats, Error>();
开发者ID:valtech-nyc,项目名称:brookjs,代码行数:8,代码来源:actions.ts
示例2: createAsyncAction
import { createAsyncAction } from 'typesafe-actions'
import { Direction } from '../../types/enums'
import { OrderType } from '../../types/interfaces'
export const getDepthAction = createAsyncAction(
'GET_DEPTH_REQUEST',
'GET_DEPTH_SUCCESS',
'GET_DEPTH_FAILURE',
)<Direction, { direction: Direction, orders: OrderType[] }, Error>()
开发者ID:Carl-Foster,项目名称:exchange-app,代码行数:9,代码来源:depth.ts
示例3: 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
示例4: createAsyncAction
import { PhotoId, PhotoType, PhotoDetail, PhotoWork, PhotoSection, PhotoSectionId, PhotoFilter } from '../../common/models/Photo'
import { TagType } from '../../common/models/Tag'
import {
SETTINGS_EXISTS_REQUEST, SETTINGS_EXISTS_SUCCESS, SETTINGS_EXISTS_FAILURE, SET_GRID_ROW_HEIGHT,
SET_DETAIL_PHOTO_REQUEST, SET_DETAIL_PHOTO_SUCCESS, SET_DETAIL_PHOTO_FAILURE,
CLOSE_DETAIL, SET_SELECTED_PHOTOS, SET_LIBRARY_INFO_PHOTO_REQUEST, SET_LIBRARY_INFO_PHOTO_SUCCESS, SET_LIBRARY_INFO_PHOTO_FAILURE,FETCH_TOTAL_PHOTO_COUNT, FETCH_SECTIONS_REQUEST, FETCH_SECTIONS_SUCCESS, FETCH_SECTIONS_FAILURE,
FETCH_SECTION_PHOTOS, FORGET_SECTION_PHOTOS,
CHANGE_PHOTOWORK, CHANGE_PHOTOS, EMPTY_TRASH, START_IMPORT, SET_IMPORT_PROGRESS, FETCH_DATES, FETCH_TAGS, SET_PHOTO_TAGS,
INIT_DEVICES, ADD_DEVICE, REMOVE_DEVICE, OPEN_DIFF, CLOSE_DIFF, OPEN_EXPORT, CLOSE_EXPORT, TOGGLE_DIFF
} from './actionTypes'
import { DatesState } from './reducers/data'
import { ImportProgress } from './reducers/import'
export const checkSettingsExistAction = createAsyncAction(SETTINGS_EXISTS_REQUEST, SETTINGS_EXISTS_SUCCESS, SETTINGS_EXISTS_FAILURE)<void, void, Error>()
export const setGridRowHeightAction = (gridRowHeight: number) => action(SET_GRID_ROW_HEIGHT, { gridRowHeight })
export const setDetailPhotoAction = createAsyncAction(SET_DETAIL_PHOTO_REQUEST, SET_DETAIL_PHOTO_SUCCESS, SET_DETAIL_PHOTO_FAILURE)<{ sectionId: PhotoSectionId, photoIndex: number, photoId: string }, { photoDetail: PhotoDetail, photoWork: PhotoWork }, Error>()
export const closeDetailAction = () => action(CLOSE_DETAIL)
export const setSelectedPhotosAction = (sectionId: PhotoSectionId, photoIds: PhotoId[]) => action(SET_SELECTED_PHOTOS, { sectionId, photoIds })
export const setLibraryInfoPhotoAction = createAsyncAction(SET_LIBRARY_INFO_PHOTO_REQUEST, SET_LIBRARY_INFO_PHOTO_SUCCESS, SET_LIBRARY_INFO_PHOTO_FAILURE)<{ sectionId: PhotoSectionId | null, photoId: PhotoId | null }, { photoDetail: PhotoDetail }, Error>()
export const fetchTotalPhotoCountAction = (totalPhotoCount: number) => action(FETCH_TOTAL_PHOTO_COUNT, { totalPhotoCount })
export const fetchSectionsAction = createAsyncAction(FETCH_SECTIONS_REQUEST, FETCH_SECTIONS_SUCCESS, FETCH_SECTIONS_FAILURE)<{ newFilter: PhotoFilter | null }, { sections: PhotoSection[] }, Error>()
export const fetchSectionPhotosAction = (sectionId: PhotoSectionId, photos: PhotoType[]) => action(FETCH_SECTION_PHOTOS, { sectionId, photos })
export const forgetSectionPhotosAction = (sectionIds: { [index: string]: true }) => action(FORGET_SECTION_PHOTOS, { sectionIds })
export const changePhotoWorkAction = (photoId: PhotoId, photoWork: PhotoWork) => action(CHANGE_PHOTOWORK, { photoId, photoWork })
export const changePhotosAction = (photos: PhotoType[], update: Partial<PhotoType>) => action(CHANGE_PHOTOS, { photos, update })
开发者ID:m0g,项目名称:ansel,代码行数:31,代码来源:actions.ts
示例5: createAsyncAction
import { createAsyncAction } from 'typesafe-actions';
import { IdentityActionTypes, IdentityPayload } from './types';
import { BranchError } from '../../common/types';
import { XboxLiveIdentity } from '../types';
export const fetchIdentity = createAsyncAction(
IdentityActionTypes.FETCH_IDENTITY,
IdentityActionTypes.FETCHED_IDENTITY_SUCCESS,
IdentityActionTypes.FETCHED_IDENTITY_FAILURE,
)<IdentityPayload, XboxLiveIdentity, BranchError>();
开发者ID:TheTree,项目名称:branch,代码行数:10,代码来源:actions.ts
注:本文中的typesafe-actions.createAsyncAction函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论