lodash-es APIs
- debounce
- uniqBy
- noop
- isEqual
- isArray
- cloneDeep
- mapValues
- merge
- uniq
- omit
- set
- get
- map
- throttle
- isEmpty
- isString
- pick
- clamp
- range
- isNil
- flatten
- keyBy
- clone
- sampleSize
- difference
- sortBy
- intersectionWith
- mergeWith
- pickBy
- identity
- isDate
- omitBy
- reject
- uniqWith
- differenceWith
- groupBy
- zip
- defaults
- times
- constant
- values
- isMap
- isNumber
- matches
- stubFalse
- stubTrue
- bind
- toPairs
- repeat
- compact
- inRange
- flatMap
- remove
- xorWith
- round
- shuffle
- reduce
- last
- padStart
- assign
- take
- lowerCase
- isObject
- find
- findIndex
- orderBy
- fromPairs
- mapKeys
- size
- isUndefined
- uniqueId
Other Related APIs
lodash-es#last TypeScript Examples
The following examples show how to use
lodash-es#last.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: History.ts From LogicFlow with Apache License 2.0 | 6 votes |
add(data) {
if (isEqual(last(this.undos), data)) return;
this.undos.push(data);
// 因为undo的时候,会触发add.
// 所以需要区分这个add是undo触发的,还是用户正常操作触发的。
// 如果是用户正常操作触发的,需要清空redos
if (!isEqual(this.curData, data)) {
this.redos = [];
}
this.eventCenter.emit(EventType.HISTORY_CHANGE,
{
data: {
undos: this.undos,
redos: this.redos,
undoAble: this.undos.length > 1,
redoAble: this.redos.length > 0,
},
});
if (this.undos.length > this.maxSize) {
this.undos.shift();
}
}