本文整理汇总了TypeScript中lodash/clone.default函数的典型用法代码示例。如果您正苦于以下问题:TypeScript default函数的具体用法?TypeScript default怎么用?TypeScript default使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了default函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: reset
/**
* Reset the new model zazu to default.
*/
reset () {
this.zazu = _clone(this.defaultZazu);
};
示例2: create
/**
* Create new zazu.
* @param {Zazu} zazu The zazu to create.
*/
create (zazu: Zazu) {
if (zazu.label.trim().length === 0) {
return;
}
this.ZazuService.create(_clone(zazu), true, this.isInMode('createUnderCurrent'));
this.resetModes();
this.refresh();
this.reset();
};
示例3: produce
import { reducerWithInitialState } from "typescript-fsa-reducers";
import clone from "lodash/clone";
import { ICategory } from "@vanilla/@types/api/categories";
export interface ICategoriesState {
suggestions: ILoadable<ICategory[]>;
}
const INITIAL_STATE: ICategoriesState = {
suggestions: {
status: LoadStatus.PENDING,
},
};
export const categoriesReducer = produce(
reducerWithInitialState(clone(INITIAL_STATE))
.case(CategorySuggestionActions.loadCategories.started, (nextState, payload) => {
nextState.suggestions.status = LoadStatus.LOADING;
return nextState;
})
.case(CategorySuggestionActions.loadCategories.done, (nextState, payload) => {
nextState.suggestions.status = LoadStatus.SUCCESS;
nextState.suggestions.data = payload.result;
return nextState;
})
.case(CategorySuggestionActions.loadCategories.failed, (nextState, payload) => {
nextState.suggestions.status = LoadStatus.ERROR;
nextState.suggestions.error = payload.error;
return nextState;
}),
);
示例4: _clone
/**
* Get the filtered zazus.
* @returns {Zazu[]} The current list of filtered zazus.
*/
get (): Zazu[] {
this.filtered = this.zazus.filter(this.isOpen.bind(this));
return _clone(this.filtered);
}
示例5: _clone
/**
* Get the list of zazus.
* @returns {Zazu[]} The current list of zazus.
*/
get (): Zazu[] {
return _clone(this.zazus) || [];
}