Skip to content

Commit 918d637

Browse files
committed
typo
1 parent 3256eee commit 918d637

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

_blogposts/community/2025-01-01-what-can-i-do-with-rescript.mdx renamed to _blogposts/community/2025-03-03-what-can-i-do-with-rescript.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
7676

7777
That's all we need to know to write bindings to use this function in ReScript.
7878
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.
79-
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.
79+
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.
8080
```res
8181
// DateFns.res - you might want to put this in a folder called "bindings" or "external"
8282
type formatDateOptions // we're not even going to add anything to this yet until we need something

0 commit comments

Comments
 (0)