dva-core
Version:
The core lightweight library for dva, based on redux and redux-saga.
14 lines (12 loc) • 413 B
JavaScript
import isPlainObject from 'is-plain-object';
export { isPlainObject };
export const isArray = Array.isArray.bind(Array);
export const isFunction = o => typeof o === 'function';
export const returnSelf = m => m;
export const noop = () => {};
export const findIndex = (array, predicate) => {
for (let i = 0, { length } = array; i < length; i += 1) {
if (predicate(array[i], i)) return i;
}
return -1;
};