File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import {
1313 useState ,
1414 useLayoutEffect ,
1515} from 'react'
16+ import { IMutation } from 'proxy-state-tree'
1617
1718export type IReactComponent < P = any > =
1819 | StatelessComponent < P >
@@ -30,6 +31,7 @@ export type TConnect<Config extends Configuration> = {
3031 overmind : {
3132 state : TApp < Config > [ 'state' ]
3233 actions : TApp < Config > [ 'actions' ]
34+ addMutationListener : ( cb : ( mutation : IMutation ) => void ) => ( ) => void
3335 }
3436}
3537
@@ -40,6 +42,7 @@ export const createHook = <A extends Overmind<Configuration>>(
4042) : ( ( ) => {
4143 state : A [ 'state' ]
4244 actions : A [ 'actions' ]
45+ addMutationListener : ( cb : ( mutation : IMutation ) => void ) => ( ) => void
4346} ) => {
4447 let currentComponentInstanceId = 0
4548 const {
Original file line number Diff line number Diff line change 66 TTree ,
77 IMutation ,
88 VALUE ,
9+ IMutationCallback ,
910} from 'proxy-state-tree'
1011import { Derived } from './derived'
1112import { Devtools , Message , safeValue , safeValues } from './Devtools'
@@ -436,7 +437,7 @@ export class Overmind<Config extends Configuration> implements Configuration {
436437 getMutationTree ( ) {
437438 return this . proxyStateTree . getMutationTree ( )
438439 }
439- addMutationListener = ( cb ) => {
440+ addMutationListener = ( cb : IMutationCallback ) => {
440441 return this . proxyStateTree . onMutation ( cb )
441442 }
442443}
You can’t perform that action at this time.
0 commit comments