Replies: 11 comments 5 replies
-
Thanks for opening a suggestion. Let's wait others to comment. One note is as such a change is breaking, it will be only possible in v5. That said, my personal comment would be a) (I understand there are many troubles, and wonder if there's any other way to mitigate it, like warning for the usage of |
Beta Was this translation helpful? Give feedback.
-
There's also an option to support it in runtime but not include it in types (ie .d.ts won't include the uncurried overload). |
Beta Was this translation helpful? Give feedback.
-
Maybe i'm misunderstanding but is this the two types of syntaxes we're discussing? type Test = {
name: string;
};
const curried = create<Test>()((set) => ({ name: "Yes" }));
const uncurried = create<Test>((set) => ({
name: "string",
})); Personally I prefer the uncurried one and find the curried one weird.. |
Beta Was this translation helpful? Give feedback.
-
Yeah, in summary:
|
Beta Was this translation helpful? Give feedback.
-
We use TS, and have used the uncurried version almost exclusively, and have not had any problems, I guess because we aren't using middleware that requires it. We tend to use type inference on factory function return types for different slices, with good results. |
Beta Was this translation helpful? Give feedback.
-
The idea of |
Beta Was this translation helpful? Give feedback.
-
There's a way to support uncurried version for TS as well with middlewares? I would like to have just one way to do both, with and without middlewares. |
Beta Was this translation helpful? Give feedback.
-
@dbritto-dev we aren't currying, but its fine because we aren't using middle-wares. It seems like some middle-wares require it. |
Beta Was this translation helpful? Give feedback.
-
@ollwenjones actually, I would like to have just one way to do both |
Beta Was this translation helpful? Give feedback.
-
@devanshj I don't remember we discussed this before, but is there any possibility to avoid currying, if we introduce a new function like |
Beta Was this translation helpful? Give feedback.
-
I would like to promote the use of |
Beta Was this translation helpful? Give feedback.
-
I've lost count of how many people have missed the extra parenthesis in
create()(...)
(and the wrong usage iecreate(...)
doesn't even get caught because it's allowed). I don't see how supporting thecreate(...)
usage adds any value, it's just creating trouble for many people (including me). I know I've suggested this before but I want to make the suggestion official hence opening an issue.Beta Was this translation helpful? Give feedback.
All reactions