Skip to content

Commit

Permalink
fix(types): enable autocomplete in object
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed Apr 9, 2021
1 parent e80366c commit b299ff0
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/mapHelpers.ts
Expand Up @@ -241,16 +241,10 @@ export function mapActions<Id extends string, S extends StateTree, G, A>(
* @param useStore - store to map from
* @param keyMapper - object to define new names for the actions
*/
export function mapActions<
Id extends string,
S extends StateTree,
G,
A,
KeyMapper extends Record<string, keyof A>
>(
export function mapActions<Id extends string, S extends StateTree, G, A>(
useStore: StoreDefinition<Id, S, G, A>,
keyMapper: KeyMapper
): MapActionsObjectReturn<A, KeyMapper>
keyMapper: Record<string, keyof A>
): MapActionsObjectReturn<A, Record<string, keyof A>>
/**
* Allows directly using actions from your store without using the composition
* API (`setup()`) by generating an object to be spread in the `methods` field
Expand Down

0 comments on commit b299ff0

Please sign in to comment.