-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e7516ba
commit 48c8339
Showing
2 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ | |
/babel.config.json | ||
/rollup.config.js | ||
/.gitattributes | ||
/MIGRATING.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Migration guides | ||
|
||
## From v2 to v3 | ||
|
||
No migrations needed with this version. We just added `rollup` as build tool and added the browser build in our examples. | ||
|
||
## From v1 to v2 | ||
|
||
The first version of `categorize` used `yup` to validate users' input. With this, the library had two ways to categorize arrays: | ||
|
||
- a synchronous way using `categorizeSync` function; | ||
- and an asynchronous way using `categorize` function. | ||
|
||
With the second version, we removed `yup` library in order to become a zero-dependency library and did the validation manually. | ||
|
||
With this change we only have one way to categorize which is the sychronous way. So we removed the `categorizeSync` function and changed the `categorize` function to become a synchronous one. | ||
|
||
### Usage from v1 | ||
|
||
```js | ||
// asynchronous way | ||
const asyncResult = await categorize(animals, categories); | ||
// synchronous way | ||
const syncResult = categorizeSync(animals, categories); | ||
``` | ||
|
||
### Usage from v2 | ||
|
||
```js | ||
const result = categorize(animals, categories); | ||
``` |