Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/srounce/sinkro
https://github.com/srounce/sinkro
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/srounce/sinkro
- Owner: srounce
- License: apache-2.0
- Created: 2018-07-01T19:44:02.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2018-09-19T14:04:09.000Z (over 6 years ago)
- Last Synced: 2024-11-06T09:19:47.921Z (2 months ago)
- Language: JavaScript
- Size: 85.9 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# SINKRO
*Plug ES Observables into React components easily!*
## Usage
```javascript
import React from 'react'
import { render } from 'react-dom'
import { subscribe } from 'sinkro'
import { timer } from 'rxjs'
import { map } from 'rxjs/operators'const NowView = ({ now }) => (
The Current time is {String(now)}
)const time$ = timer(0, 50).pipe(map(() => new Date()))
const SubscribedNowView = subscribe({
now: time$
})(SubscribedNowView)const appRootElement = document.createElement('div')
document.body.appendChild(appRootElement)render(
,
document.getElementById('app-container')
)
```### Prerequisites
* [`react`](https://npmjs.com/package/react) is required (I aim to provoide Vue support in future releases).
### Installing
```
yarn add sinkro
```## Running the tests
Ensure all prerequisites are installed by running `yarn` or `npm install`
then run the test suite with: `yarn test`## Contributing
Please read [CONTRIBUTING.md](CONTRIBUTING.md) for details on the code of conduct, and the process for submitting pull requests.
## Versioning
We use [SemVer](http://semver.org/) for versioning. For the versions available, see the tags on this repository.
## Authors
* **Samuel Rounce** - [srounce](https://github.com/srounce)
See also the list of contributors who participated in this project.
## License
This project is licensed under the Apache 2.0 License - see the [LICENSE.md](LICENSE.md) file for details