Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
imbhargav5 committed Jan 20, 2019
1 parent 1d80589 commit d9f78c0
Show file tree
Hide file tree
Showing 82 changed files with 88 additions and 1,228 deletions.
60 changes: 25 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ render(<Demo/>)
| ------------ | ------- | ---------------------------------------------------------------------------- | ------------- |
| value | DOMRect | DOMRect Object containing x,y, width, height, left,right,top and bottom keys | null |

Bounding client rect hook for React
Bounding client rect hook for React.
# @rooks/use-counter

### Installation
Expand Down Expand Up @@ -149,7 +149,7 @@ render(<CounterComponent/>)
| ------------ | ------ | --------------------------------------------------------------------------- |
| counter | Object | Object containing {value,increment,decrement,incrementBy,decrementBy,reset} |

Counter hook for React
Counter hook for React.
# @rooks/use-did-mount

### Installation
Expand Down Expand Up @@ -177,7 +177,7 @@ render(<Demo/>)
| -------- | -------- | ------------------------------ |
| callback | function | function to be called on mount |

# A React hooks package for componentDidMount
# A React hooks package for componentDidMount.
# @rooks/use-input

### Installation
Expand Down Expand Up @@ -246,7 +246,7 @@ render(<Demo/>)
| ----------------- | ------ | -------------------------------------------------------------------------------------------------------------------- |
| {value, onChange} | Object | Object containing {value : "String", onChange: "function that accepts an event and updates the value of the string"} |

Input hook for React
Input hook for React.
# @rooks/use-interval

### Installation
Expand Down Expand Up @@ -308,7 +308,7 @@ render(<Demo/>)
| intervalId | intervalId | IntervalId of the interval |


# A react hook for using setInterval
# A react hook for using setInterval.
# @rooks/use-key

### Installation
Expand Down Expand Up @@ -421,7 +421,7 @@ function Demo() {
render(<Demo />);
```

# Keyboard key handler hook for react
# Keyboard key handler hook for react.
# @rooks/use-localstorage

Sets and retrieves a key from localStorage and subscribes to it for updates across windows.
Expand Down Expand Up @@ -451,7 +451,7 @@ function Demo() {
render(<Demo />);
```

# Local Storage hook for React
# Local Storage hook for React.
# @rooks/use-mouse

### Installation
Expand Down Expand Up @@ -484,7 +484,7 @@ render(<Demo/>)
| x | int | X position of mouse |
| y | int | Y position of mouse |

Mouse hook for React
Mouse hook for React.
# @rooks/use-mutation-observer

### Installation
Expand Down Expand Up @@ -560,7 +560,7 @@ render(<Demo/>)
| callback | function | Function which should be invoked on mutation. It is called with the `mutationList` and `observer` | undefined |
| config | object | Mutation Observer configuration | {attributes: true,,characterData: true,,subtree: true,,childList: true} |

Mutation Observer hook for React
Mutation Observer hook for React.
# @rooks/use-navigator-language

### Installation
Expand All @@ -573,18 +573,18 @@ npm install --save @rooks/use-navigator-language

```jsx
function Demo() {
const language = useNavigatorLanguage();
const language = useNavigatorLanguage();
return <p>Language is {language}</p>;
}

render(<Demo/>)
render(<Demo />);
```

### Return value

A language (String) is returned.

Navigator Language hook for React
Navigator Language hook for React.
# @rooks/use-online

### Installation
Expand All @@ -601,14 +601,14 @@ function Demo() {
return <p>Online status - {isOnline.toString()}</p>;
}

render(<Demo/>)
render(<Demo />);
```

### Return value

Offline status (boolean) is returned.

Online Status hook for React
Online Status hook for React.
# @rooks/use-outside-click

### Installation
Expand Down Expand Up @@ -636,7 +636,7 @@ function Demo() {
render(<Demo />);
```

# React hook for tracking clicks outside a ref
# React hook for tracking clicks outside a ref.
# @rooks/use-select

### Installation
Expand Down Expand Up @@ -698,7 +698,7 @@ render(<Demo/>)
| setIndex | function | Update selected index |
| setItem | function | Update selected item |

List Selection hook for React
List Selection hook for React.
# @rooks/use-sessionstorage

### Installation
Expand Down Expand Up @@ -726,7 +726,7 @@ function Demo() {
render(<Demo />);
```

# Session storage react hook. Easily manage session storage values
# Session storage react hook. Easily manage session storage values.
# @rooks/use-time-ago

### Installation
Expand Down Expand Up @@ -774,7 +774,7 @@ render(<Demo/>)

Timeago string is returned.

# A React Hook to get time ago for timestamp millisecond value
# A React Hook to get time ago for timestamp millisecond value.
# @rooks/use-timeout

### Installation
Expand Down Expand Up @@ -816,7 +816,7 @@ render(<TimeoutComponent/>)
| clear | function | Clear the timeout |
| start | function | Start the timeout |

Timeout hook for React
Timeout hook for React.
# @rooks/use-toggle

### Installation
Expand Down Expand Up @@ -877,21 +877,10 @@ render(<Demo/>)
| value | Any | Current value |
| toggleValue | function | Toggle function which changes the value to the other value in the list of 2 acceptable values. (Mostly true or false) |

Toggle hook for React
# `tools`

> TODO: description
## Usage

```
const tools = require('tools');
// TODO: DEMONSTRATE API
```
Toggle hook for React.
# @rooks/use-visibility-sensor

Visibility sensor hook for React
Visibility sensor hook for React.

### Installation

Expand Down Expand Up @@ -974,6 +963,7 @@ The first argument of the `useVisibilitySensor` hook is a ref, the second argume
- [x] Documentation of all options
- [x] Tests _ WIP _
- [ ] More examples _ WIP _
# Rooks website
# @rooks/use-will-unmount

### Installation
Expand Down Expand Up @@ -1020,7 +1010,7 @@ render(<Demo/>)
| --------- | -------- | ----------------------------------------------- | ------------- |
| callback | function | Callback function which needs to run on unmount | undefined |

# A React hook for componentWillUnmount lifecycle method
# A React hook for componentWillUnmount lifecycle method.
# @rooks/use-window-size

### Installation
Expand Down Expand Up @@ -1068,7 +1058,7 @@ render(<WindowComponent/>)
| outerWidth | int | outer height of window |
| outerHeight | int | outer width of window |

Window size hook for React
Window size hook for React.
# @rooks/use-worker

### Installation
Expand Down Expand Up @@ -1111,4 +1101,4 @@ ReactDOM.render(<Demo />, rootElement);

The worker instance is returned.

### Worker hook for React
### Worker hook for React.
25 changes: 5 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"private": true,
"description": "React hooks.",
"scripts": {
"dev": "cd packages/website && npm run dev",
"deploy": "cd packages/website && npm run deploy",
"clean": "lerna clean",
"dev": "cd packages/website && yarn dev",
"deploy": "cd packages/website && yarn deploy",
"predeploy": "node helpers/update_readme",
"prepare:deploy": "cd packages/website/src && yarn",
"create": "node helpers/create",
Expand All @@ -15,14 +16,11 @@
"release": "lerna publish"
},
"devDependencies": {
"@rooks/use-select": "0.1.0",
"@babel/cli": "^7.1.5",
"@babel/core": "^7.1.5",
"@babel/preset-env": "^7.1.5",
"@babel/preset-react": "^7.0.0",
"@fortawesome/fontawesome-svg-core": "1.2.8",
"@fortawesome/free-solid-svg-icons": "5.5.0",
"@fortawesome/react-fontawesome": "0.1.3",
"@rooks/use-select": "0.1.0",
"@types/react": "16.7.18",
"@types/react-dom": "16.0.11",
"babel-core": "^7.0.0-bridge.0",
Expand All @@ -37,26 +35,13 @@
"meow": "5.0.0",
"ora": "3.0.0",
"raf": "3.4.1",
"react": "16.7.0-alpha.2",
"react-dom": "16.7.0-alpha.2",
"react-testing-library": "^5.2.3",
"read-pkg-up": "4.0.0",
"replace-string": "2.0.0",
"shelljs": "0.8.3",
"write-pkg": "3.2.0"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "1.2.8",
"@fortawesome/free-solid-svg-icons": "5.5.0",
"@fortawesome/react-fontawesome": "0.1.3",
"@rooks/use-select": "0.1.0",
"chalk": "2.4.1",
"inquirer": "6.2.0",
"make-dir": "1.3.0",
"ora": "3.0.0",
"replace-string": "2.0.0",
"shelljs": "0.8.3"
},
"dependencies": {},
"workspaces": [
"packages/*"
]
Expand Down
13 changes: 0 additions & 13 deletions packages/tools/README.md

This file was deleted.

7 changes: 0 additions & 7 deletions packages/tools/__tests__/tools.test.js

This file was deleted.

58 changes: 0 additions & 58 deletions packages/tools/package.json

This file was deleted.

File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions packages/website/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
dist
out
_readmes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions packages/website/now.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"alias": ["react-hooks.org"],
"version": 2,
"builds": [
{ "src": "src/package.json", "use": "@now/static-build" },
{ "src": "package.json", "use": "@now/static-build" },
{
"src": "api/hooks/*.js",
"use": "@now/node"
Expand All @@ -18,7 +18,7 @@
},
{
"src": "/(.*)",
"dest": "/src/$1"
"dest": "/$1"
}
]
}
Loading

0 comments on commit d9f78c0

Please sign in to comment.