https://github.com/jadbox/rxhooks_examples
React Hook support for Observable Streams
https://github.com/jadbox/rxhooks_examples
Last synced: 17 days ago
JSON representation
React Hook support for Observable Streams
- Host: GitHub
- URL: https://github.com/jadbox/rxhooks_examples
- Owner: jadbox
- Created: 2019-02-05T05:48:48.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-16T00:08:13.000Z (over 7 years ago)
- Last Synced: 2025-03-04T07:32:09.024Z (over 1 year ago)
- Language: TypeScript
- Homepage: https://github.com/jadbox/rxhooks
- Size: 172 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PROJECT MOVED
Project moved to https://github.com/jadbox/rxhooks
### Just Show Me the Code
```javascript
function ExampleUseRxState() {
const initialVal = 1;
const [count, signalCount] = useRxState(initialVal,
scan( (acc, x) => x+acc, 0)
);
const onClick = () => {
signalCount(1);
}
return <>
Add 1
count {count}
>
}
function ExampleUseRx() {
const stream = (x) => interval(1000 * x);
const [speed, setSpeed] = useState(1);
const [count] = useRx( stream, speed );
return <>
setSpeed(speed+1)}>Make slower via initialValue change
speed {speed}{' '}|{' '}count {count}
>
}
class App extends Component {
render() {
return (
);
}
}
export default App;
```