From 918d6376272338da994d3bd4bfd16905b4cb3e86 Mon Sep 17 00:00:00 2001 From: Josh Vlk Date: Tue, 4 Mar 2025 08:42:11 -0500 Subject: [PATCH] typo --- ...-rescript.mdx => 2025-03-03-what-can-i-do-with-rescript.mdx} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename _blogposts/community/{2025-01-01-what-can-i-do-with-rescript.mdx => 2025-03-03-what-can-i-do-with-rescript.mdx} (98%) diff --git a/_blogposts/community/2025-01-01-what-can-i-do-with-rescript.mdx b/_blogposts/community/2025-03-03-what-can-i-do-with-rescript.mdx similarity index 98% rename from _blogposts/community/2025-01-01-what-can-i-do-with-rescript.mdx rename to _blogposts/community/2025-03-03-what-can-i-do-with-rescript.mdx index 3eb403a4c..644914f01 100644 --- a/_blogposts/community/2025-01-01-what-can-i-do-with-rescript.mdx +++ b/_blogposts/community/2025-03-03-what-can-i-do-with-rescript.mdx @@ -76,7 +76,7 @@ const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy') That's all we need to know to write bindings to use this function in ReScript. The first thing we need to figure out is how to handle the type for what `date-fns` considers to be a `date`, which is `Date | string | number`. In ReScript things can't just be of different types like they can in JavaScript or TypeScript. There are a couple options here; you can make a function for each type such as `formatString` and `formatDate`, or you can create a [variant type](/docs/manual/latest/variant) to map to the possible input types. -Creating a function for each type is simpler, and it's most likely how you will use the library in your project. You probably have a standard type for Dates already. We'll also need a type for `FormatDateOptions` in case we want to pass options. We'll use [labled arguments](/docs/manual/latest/function#labeled-arguments) for our binding. +Creating a function for each type is simpler, and it's most likely how you will use the library in your project. You probably have a standard type for Dates already. We'll also need a type for `FormatDateOptions` in case we want to pass options. We'll use [labeled argmuments](/docs/manual/latest/function#labeled-arguments) for our binding. ```res // DateFns.res - you might want to put this in a folder called "bindings" or "external" type formatDateOptions // we're not even going to add anything to this yet until we need something