Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to rescript@11 #3

Merged
merged 6 commits into from
Feb 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ node_modules/
lib/
.merlin
.bsb.lock
*.bs.js
*.res.js
3 changes: 3 additions & 0 deletions rescript-throttle-react/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# History

### 2.0.0
- `rescript` is updated to `v11`.

### 1.0.1
- Fix dead links in READMEs.

Expand Down
8 changes: 4 additions & 4 deletions rescript-throttle-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ yarn add rescript-throttle-react
npm install --save rescript-throttle-react
```

Then add it to `bsconfig.json`:
Then add it to `rescript.json`:

```json
"bs-dependencies": [
Expand All @@ -32,13 +32,13 @@ Then add it to `bsconfig.json`:

```rescript
// With default timeout (100ms)
let fn = ReactThrottle.useThrottled(fn)
let fn = fn->ReactThrottle.useThrottled

// With configured timeout
let fn = ReactThrottle.useThrottled(~wait=250, fn)
let fn = fn->ReactThrottle.useThrottled(~wait=250)

// Controlled hook
let fn = ReactThrottle.useControlled(fn)
let fn = fn->ReactThrottle.useControlled
```

See [`rescript-throttle`](https://www.npmjs.com/package/rescript-throttle) for more details.
Expand Down
18 changes: 0 additions & 18 deletions rescript-throttle-react/bsconfig.json

This file was deleted.

140 changes: 79 additions & 61 deletions rescript-throttle-react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions rescript-throttle-react/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "rescript-throttle-react",
"version": "1.0.1",
"version": "2.0.0",
"description": "Throttle hooks for @rescript/react",
"author": "Alex Fedoseev <alex@fedoseev.mx>",
"author": "Alex Fedoseev <alex@35mil.me>",
"license": "MIT",
"homepage": "https://github.com/shakacode/rescript-throttle",
"repository": {
Expand All @@ -19,7 +19,7 @@
},
"files": [
"src",
"bsconfig.json"
"rescript.json"
],
"keywords": [
"react",
Expand All @@ -33,10 +33,10 @@
"throttle"
],
"dependencies": {
"rescript-throttle": "^1.0.0"
"rescript-throttle": "^2.0.0"
},
"devDependencies": {
"@rescript/react": "0.10.3",
"rescript": "10.0.1"
"@rescript/react": "0.12.1",
"rescript": "11.0.1"
}
}
18 changes: 18 additions & 0 deletions rescript-throttle-react/rescript.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "rescript-throttle-react",
"sources": [
"src"
],
"bs-dependencies": [
"@rescript/react",
"rescript-throttle"
],
"package-specs": {
"module": "es6",
"in-source": true
},
"suffix": ".res.js",
"warnings": {
"number": "+A-42-48"
}
}
4 changes: 2 additions & 2 deletions rescript-throttle-react/src/ReactThrottle.res
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
let useThrottled = (~wait=?, fn) => {
let ref = React.useRef(Throttle.make(~wait?, fn))
let ref = fn->Throttle.make(~wait?)->React.useRef
ref.current
}

let useControlled = (~wait=?, fn) => {
let ref = React.useRef(Throttle.makeControlled(~wait?, fn))
let ref = fn->Throttle.makeControlled(~wait?)->React.useRef
ref.current
}
2 changes: 1 addition & 1 deletion rescript-throttle-react/src/ReactThrottle.resi
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
let useThrottled: (~wait: int=?, 'a => unit, 'a) => unit
let useThrottled: (~wait: int=?, 'a => unit) => 'a => unit
let useControlled: (~wait: int=?, 'a => unit) => Throttle.throttled<'a>
5 changes: 4 additions & 1 deletion rescript-throttle/HISTORY.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# History

### 0.0.1
### 2.0.0
- `rescript` is updated to `v11`.

### 1.0.1
- Fix dead links in READMEs.

### 0.0.1
Expand Down
Loading
Loading