Skip to content

Commit

Permalink
refactor(interceptors): re-use Fn type aliases
Browse files Browse the repository at this point in the history
  • Loading branch information
postspectacular committed Mar 8, 2019
1 parent a9b1667 commit 9ebe677
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions packages/interceptors/src/interceptors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Fn } from "@thi.ng/api";
import { Fn, FnO } from "@thi.ng/api";
import {
getIn,
Path,
Expand Down Expand Up @@ -266,10 +266,7 @@ export const valueSetter = <T>(path: Path, tx?: Fn<T, T>): InterceptorFn => {
* @param path
* @param fn
*/
export const valueUpdater = <T>(
path: Path,
fn: (x: T, ...args: any[]) => T
): InterceptorFn => {
export const valueUpdater = <T>(path: Path, fn: FnO<T, T>): InterceptorFn => {
const $ = updater(path, fn);
return (state, [_, ...args]) => ({ [FX_STATE]: $(state, ...args) });
};

0 comments on commit 9ebe677

Please sign in to comment.