本文整理匯總了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
}
}
示例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)
}
}
示例3: remove
remove(val) {
return this.create(without(this.getValue(), val))
}
示例4: remove
remove(level:number, val) {
return this.create(update(this.getValue(), {
[level]:{$set:without(this.getValue()[level], val)}
}))
}