本文整理汇总了TypeScript中client/lib/keyMirror.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: keyMirror
import keyMirror from "client/lib/keyMirror"
export const actions = keyMirror("ERROR")
/**
* Actions related to rendering errors to the client via ErrorBoundary
*/
export const logError = (error: { message: string }) => ({
type: actions.ERROR,
payload: {
error,
},
})
export const resetError = () => ({
type: actions.ERROR,
payload: {
error: null,
},
})
示例2: keyMirror
import {
SectionData,
SectionType,
} from "@artsy/reaction/dist/Components/Publishing/Typings"
import {
changeArticleData,
debouncedSaveDispatch,
onChangeArticle,
} from "client/actions/edit/articleActions"
import keyMirror from "client/lib/keyMirror"
import { clone, cloneDeep } from "lodash"
import { clean, stripTags } from "underscore.string"
export const actions = keyMirror(
"CHANGE_SECTION",
"NEW_SECTION",
"REMOVE_SECTION",
"SET_SECTION"
)
export const changeSection = (key: string, value: any) => {
return {
type: actions.CHANGE_SECTION,
payload: {
key,
value,
},
}
}
export const newHeroSection = (type: SectionType) => {
const section = setupSection(type)
示例3: keyMirror
import { emitAction } from "client/apps/websocket/client"
import { messageTypes } from "client/apps/websocket/messageTypes"
import keyMirror from "client/lib/keyMirror"
import { Channel } from "client/typings"
export const actions = keyMirror("VIEW_ARTICLES", "EDITED_ARTICLES_RECEIVED")
/**
* Actions related to viewing the articles list view at /articles
*/
/**
* Called when visiting /articles, updates list to indicate
* articles that are currently being edited by other users
*/
export const viewArticles = emitAction((channel: Channel) => ({
type: actions.VIEW_ARTICLES,
key: messageTypes.articlesRequested,
payload: {
channel,
timestamp: new Date().toISOString(),
},
}))
示例4: require
import keyMirror from "client/lib/keyMirror"
const Article = require("client/models/article.coffee")
import { clone, cloneDeep, debounce, set } from "lodash"
import {
debouncedUpdateDispatch,
redirectToList,
} from "../../../client/actions/edit/editActions"
export const actions = keyMirror(
"CHANGE_SAVED_STATUS",
"CHANGE_ARTICLE",
"DELETE_ARTICLE",
"ON_FIRST_SAVE",
"PUBLISH_ARTICLE",
"SAVE_ARTICLE",
"SET_MENTIONED_ITEMS",
"SET_SEO_KEYWORD"
)
/**
* Actions related to saving, publishing, deleting an individual article
* functions in this file apply to all edit sub-apps (content, display, admin)
*/
/**
* Update isSaved, used to change colors of the the main UI save button
* which renders in red (unsaved changes) or green (saved)
*/
export const changeSavedStatus = (article, isSaved: boolean) => {
return {
type: actions.CHANGE_SAVED_STATUS,