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 #14

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-debounce-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
145 changes: 71 additions & 74 deletions rescript-debounce-react/package-lock.json

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

8 changes: 4 additions & 4 deletions rescript-debounce-react/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "rescript-debounce-react",
"version": "1.0.1",
"version": "2.0.0",
"description": "Debounce hooks for @rescript/react",
"author": "Alex Fedoseev <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -33,10 +33,10 @@
"debounce"
],
"dependencies": {
"rescript-debounce": "^1.0.0"
"rescript-debounce": "^2.0.0"
},
"devDependencies": {
"@rescript/react": "0.10.3",
"rescript": "10.0.1"
"@rescript/react": "0.12.1",
"rescript": "11.0.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@
"rescript-debounce"
],
"package-specs": {
"module": "commonjs",
"module": "es6",
"in-source": true
},
"suffix": ".bs.js",
"suffix": ".res.js",
"warnings": {
"number": "+A-42-48"
}
Expand Down
4 changes: 2 additions & 2 deletions rescript-debounce-react/src/ReactDebounce.res
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
let useDebounced = (~wait=?, fn) => {
let ref = React.useRef(Debounce.make(~wait?, fn))
let ref = fn->Debounce.make(~wait?)->React.useRef
ref.current
}

let useControlled = (~wait=?, fn) => {
let ref = React.useRef(Debounce.makeControlled(~wait?, fn))
let ref = fn->Debounce.makeControlled(~wait?)->React.useRef
ref.current
}
2 changes: 1 addition & 1 deletion rescript-debounce-react/src/ReactDebounce.resi
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
let useDebounced: (~wait: int=?, 'a => unit, 'a) => unit
let useDebounced: (~wait: int=?, 'a => unit) => 'a => unit
let useControlled: (~wait: int=?, 'a => unit) => Debounce.debounced<'a>
3 changes: 3 additions & 0 deletions rescript-debounce/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
6 changes: 3 additions & 3 deletions rescript-debounce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ Then add it to `bsconfig.json`:

```rescript
// Pass function you want to debounce
let fn = Debounce.make(fn)
let fn = fn->Debounce.make

// You can configure timeout. Default is 100ms.
let fn = Debounce.make(~wait=500, fn)
let fn = fn->Debounce.make(~wait=500)

// This call is debounced
fn()
Expand All @@ -44,7 +44,7 @@ fn()
Also, you can get more control over the debouncing:

```rescript
let fn = Debounce.makeControlled(fn)
let fn = fn->Debounce.makeControlled

// Schedule invocation
fn.schedule()
Expand Down
Loading
Loading