[Question] Integrating InfernoJS
Hi, I have an existing project written with InfernoJS and terrible javascript. I have previous experience with ReasonML, and ReScript looks like something I would enjoy much more than what I currently...
View Article[Question] Integrating InfernoJS
With the most 11.1 release, there’s the ability to use a custom JSX library, which seems like a good place to start. Not quite sure how state would work, though, given that inferno seems to rely on...
View ArticleHow to bind this kind of function?
This works only when we use this instance alone, in your example, the response will be the same for each other methods (here is an example).
View ArticleHow to bind this kind of function?
Per the library docs, doesn’t calling ky return its own custom response type? Perhaps you’d need to model, that, too, e.g this playground.
View ArticleHow to bind this kind of function?
Yes, I omit this part in my example to keep it basic. I made pretty much all the bindings except this last one I need for a specific use case I’m working on. let kyInstance =...
View ArticleHow to bind this kind of function?
DCKT: let kyInstance = Ky.Instance.create({prefixUrl: "someBasePath"}) kyInstance("path", {method: "GET"}).json() kyInstance.get("path").json() This pattern is never going to look and feel very...
View ArticleOh no, we're toast because of PPX usage
Thanks for the help, everybody! I’m circling back here to say that we’ve upgraded Decco to support Rescript 11 now, and added support for the new record spreading syntax in types! GitHub Release...
View ArticleHow to bind this kind of function?
Yes I know, I wanted to match closely the JS API at first but I think I’ll move to a module way with a type t like in the previous comments. Thanks for your answers everyone
View ArticleHow to bind this kind of function?
If type t doesn’t need to reference itself (return itself in this case) then you could make it a function type directly and have both that and @send functions for the other methods. Then you’d get rid...
View ArticleEscaping the word type
Hello, I’m trying to write some bindings for ReactMapGL and they use the word type a lot in props or properties of props. Example: type sourceData = { \"type": string, // Is this correct? geometry:...
View ArticleEscaping the word type
It’ll probably be more ergonomic to use the @as annotation instead, which would let you use whatever name you wanted within rescript, e.g.: type sourceData = { @as("type") type_: string, geometry:...
View ArticleOh no, we're toast because of PPX usage
Impressive work! Quite a lot of intricate internal stuff to understand for this to work.
View ArticleOh no, we're toast because of PPX usage
Thank you! Somehow we felt our way through piece by piece
View ArticleHow to bind this kind of function?
Since this is something that comes up from time to time, you can also just add another binding to create that returns the instance typed as a function directly, that then return t when invoked:...
View ArticleEscaping the word type
Do you mean for example type=“button” for buttons? Just pass type_="button" as prop. It will be converted automatically.
View ArticleLooking for a React.memo() Example
Looks like wrapping the make function definition in React.memo is indeed sufficient. For example, in the following code, changing the Input’s text will only rerender Counter if the first letter is...
View ArticleError compiling @rescript/core with Rescript 11
fham: explain @rescript/core @rescript/core@1.3.0 node_modules/@rescript/core @rescript/core@"^1.3.0" from the root project @rescript/core@1.3.0 ../rescript-auth0-react/node_modules/@rescript/core...
View ArticleOh no, we're toast because of PPX usage
Hey, I use GitHub - green-labs/ppx_spice: ReScript PPX which generates the JSON (de)serializers which is based on Decco, it’s pretty neat and maybe could save you some effort migrating
View Article