Skip to content

Commit

Permalink
Merge pull request #14 from shakacode/rescript-11
Browse files Browse the repository at this point in the history
Update to rescript@11
  • Loading branch information
alex35mil authored Feb 16, 2024
2 parents da76cc8 + cce20c3 commit 1d91806
Show file tree
Hide file tree
Showing 19 changed files with 6,173 additions and 7,165 deletions.
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

0 comments on commit 1d91806

Please sign in to comment.