https://github.com/alanbsmith/cog-spinner
an example app using React's context API
https://github.com/alanbsmith/cog-spinner
Last synced: over 1 year ago
JSON representation
an example app using React's context API
- Host: GitHub
- URL: https://github.com/alanbsmith/cog-spinner
- Owner: alanbsmith
- License: mit
- Created: 2018-03-29T04:59:08.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-29T15:57:16.000Z (over 8 years ago)
- Last Synced: 2025-02-02T19:33:27.000Z (over 1 year ago)
- Language: JavaScript
- Homepage: https://alanbsmith.github.io/cog-spinner/
- Size: 226 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cog Spinner
_an example app using React's context API_
## Live Demo!
You can view this demo live [here](https://alanbsmith.github.io/cog-spinner/)!
## Overview
This is an example repo to demo React's context API and the compound component pattern. This was intentionally built in a progression for you to follow along:
* Step 0 - initial setup with functioning components
* Step 1 - initial refactor
* Step 2 - add context API
* Step 3 - final refactor
### STEP 0
Initial setup with functioning components
To view this step:
```sh
$ git checkout initial-setup
```
### STEP 1
Initial refactor to extract cog-related components from App
To view this step:
```sh
$ git checkout step-one
```
### STEP 2
Add context API but not cleaned up
To view this step:
```sh
$ git checkout step-two
```
### STEP 3
Final refactor with additional code comments
To view this step:
```sh
$ git checkout step-three
```
## Up & Running
Install dependencies:
```
$ yarn install
```
Fire up a development server:
```
$ yarn start
```
Once the server is running, you can visit `http://localhost:8080/`
## License
[MIT](LICENSE)