@@ -16,8 +16,6 @@ module React.Hooks
16
16
, useReducerLazy
17
17
, dispatch
18
18
, Dispatch
19
- , Action_
20
- , Action
21
19
22
20
, useCallback
23
21
, callbackInput
@@ -137,50 +135,46 @@ foreign import useContext_
137
135
a
138
136
139
137
useReducer
140
- :: forall r a
141
- . (a -> Action r -> a )
138
+ :: forall a b
139
+ . (a -> b -> a )
142
140
-> a
143
- -> Effect (Tuple a (Dispatch ( Action r ) ))
141
+ -> Effect (Tuple a (Dispatch a b ))
144
142
useReducer = runEffectFn3 useReducer_ Tuple <<< mkFn2
145
143
146
144
useReducerLazy
147
- :: forall r a
148
- . (a -> Action r -> a )
145
+ :: forall a b
146
+ . (a -> b -> a )
149
147
-> a
150
- -> Action r
151
- -> Effect (Tuple a (Dispatch ( Action r ) ))
148
+ -> b
149
+ -> Effect (Tuple a (Dispatch a b ))
152
150
useReducerLazy = runEffectFn4 useReducerLazy_ Tuple <<< mkFn2
153
151
154
152
dispatch
155
- :: forall r
156
- . Dispatch ( Action r )
157
- -> Action r
153
+ :: forall a b
154
+ . Dispatch a b
155
+ -> a
158
156
-> Effect Unit
159
157
dispatch k = runEffectFn1 k'
160
158
where
161
- k' :: EffectFn1 ( Action r ) Unit
159
+ k' :: EffectFn1 a Unit
162
160
k' = unsafeCoerce k
163
161
164
- foreign import data Dispatch :: Type -> Type
165
-
166
- foreign import data Action_ :: # Type -> Type
167
-
168
- type Action r = Action_ ( type :: String | r )
162
+ foreign import data Dispatch :: Type -> Type -> Type
169
163
170
164
foreign import useReducer_
171
- :: forall r a
172
- . EffectFn3 (a -> Dispatch ( Action r ) -> Tuple a (Dispatch ( Action r ) ))
173
- (Fn2 a ( Action r ) a )
165
+ :: forall a b
166
+ . EffectFn3 (a -> Dispatch a b -> Tuple a (Dispatch a b ))
167
+ (Fn2 a b a )
174
168
a
175
- (Tuple a (Dispatch ( Action r ) ))
169
+ (Tuple a (Dispatch a b ))
176
170
177
171
foreign import useReducerLazy_
178
- :: forall r a
179
- . EffectFn4 (a -> Dispatch ( Action r ) -> Tuple a (Dispatch ( Action r ) ))
180
- (Fn2 a ( Action r ) a )
172
+ :: forall a b
173
+ . EffectFn4 (a -> Dispatch a b -> Tuple a (Dispatch a b ))
174
+ (Fn2 a b a )
181
175
a
182
- ( Action r )
183
- (Tuple a (Dispatch ( Action r ) ))
176
+ b
177
+ (Tuple a (Dispatch a b ))
184
178
185
179
useCallback
186
180
:: forall a b
0 commit comments