當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript without.default函數代碼示例

本文整理匯總了TypeScript中lodash/without.default函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript default函數的具體用法?TypeScript default怎麽用?TypeScript default使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了default函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: dragOperation

export default function dragOperation(
	state: State = initialState,
	action: Action<{
		itemType: Identifier | Identifier[]
		item: any
		sourceId: string
		targetId: string
		targetIds: string[]
		isSourcePublic: boolean
		dropResult: any
	}>,
) {
	const { payload } = action
	switch (action.type) {
		case BEGIN_DRAG:
			return {
				...state,
				itemType: payload.itemType,
				item: payload.item,
				sourceId: payload.sourceId,
				isSourcePublic: payload.isSourcePublic,
				dropResult: null,
				didDrop: false,
			}
		case PUBLISH_DRAG_SOURCE:
			return {
				...state,
				isSourcePublic: true,
			}
		case HOVER:
			return {
				...state,
				targetIds: payload.targetIds,
			}
		case REMOVE_TARGET:
			if (state.targetIds.indexOf(payload.targetId) === -1) {
				return state
			}
			return {
				...state,
				targetIds: without(state.targetIds, payload.targetId),
			}
		case DROP:
			return {
				...state,
				dropResult: payload.dropResult,
				didDrop: true,
				targetIds: [],
			}
		case END_DRAG:
			return {
				...state,
				itemType: null,
				item: null,
				sourceId: null,
				dropResult: null,
				didDrop: false,
				isSourcePublic: null,
				targetIds: [],
			}
		default:
			return state
	}
}
開發者ID:chenermeng,項目名稱:react-dnd,代碼行數:64,代碼來源:dragOperation.ts

示例2: remove

 remove(accessor){
   if(!accessor){
     return
   }
   accessor.decrementRef()
   if(accessor.refCount === 0){
     if(accessor instanceof StatefulAccessor){
       if(this.queryAccessor == accessor){
         this.queryAccessor = noopQueryAccessor
       }
       delete this.statefulAccessors[accessor.key]
     }
     this.accessors = without(this.accessors, accessor)
   }
 }
開發者ID:Eric013,項目名稱:searchkit,代碼行數:15,代碼來源:AccessorManager.ts

示例3: remove

 remove(val) {
   return this.create(without(this.getValue(), val))
 }
開發者ID:Baltox,項目名稱:searchkit,代碼行數:3,代碼來源:ArrayState.ts

示例4: remove

 remove(level:number, val) {
   return this.create(update(this.getValue(), {
     [level]:{$set:without(this.getValue()[level], val)}
   }))
 }
開發者ID:Baltox,項目名稱:searchkit,代碼行數:5,代碼來源:LevelState.ts


注:本文中的lodash/without.default函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。