Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Commit

Permalink
fix: lodash -> lodash.isequal (#14)
Browse files Browse the repository at this point in the history
* fix: lodash -> lodash.isequal

* update
  • Loading branch information
sorrycc authored Dec 11, 2019
1 parent cca119a commit 371e1d6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 0 additions & 2 deletions src/helpers/isEqual.ts

This file was deleted.

5 changes: 3 additions & 2 deletions src/utils/getUseModelContent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { join } from 'path';

export default function() {
return `import { useState, useEffect, useContext, useRef } from 'react';
import isEqual from '${require.resolve('lodash.isequal')}';
import { UmiContext } from '${join(__dirname, '..', 'helpers', 'constant')}';
import { Model } from './provider';
import { isEqual } from 'lodash';
export function useModel<T extends keyof Model<T>>(model: T): Model<T>[T]
export function useModel<T extends keyof Model<T>, U>(model: T, selector: (model: Model<T>[T]) => U): U
Expand Down Expand Up @@ -42,7 +42,8 @@ export function useModel<T extends keyof Model<T>, U>(
return () => {
dispatcher.callbacks![namespace]!.delete(handler);
}
}, [namespace])
}, [namespace]);
return state;
};
`;
Expand Down

0 comments on commit 371e1d6

Please sign in to comment.