Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: examples folder refactoring #3919

Closed
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 19 additions & 46 deletions docs/introduction/Examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Or check out the [sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/ma

<iframe class="codesandbox"src="https://codesandbox.io/embed/github/reduxjs/redux/tree/master/examples/counter"sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>

This is the most basic example of using Redux together with React. For simplicity, it re-renders the React component manually when the store changes. In real projects, you will likely want to use the highly performant [React Redux](https://github.com/reduxjs/react-redux) bindings instead.
This is the most basic example of using Redux together with React and it's also a `create-react-app` template.
So it's the same code you'd get running `npx create-react-app my-app --template redux`

This example includes tests.

Expand Down Expand Up @@ -84,44 +85,6 @@ Or check out the [sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/ma

This is a variation on the previous example. It is almost identical, but additionally shows how wrapping your reducer with [Redux Undo](https://github.com/omnidan/redux-undo) lets you add a Undo/Redo functionality to your app with a few lines of code.

## Todos w/ Flow

Run the [Todos w/ Flow](https://github.com/reduxjs/redux/tree/master/examples/todos-flow) example:

```sh
git clone https://github.com/reduxjs/redux.git

cd redux/examples/todos-flow
npm install
npm start
```

Or check out the [sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/todos-flow):

<iframe class="codesandbox"src="https://codesandbox.io/embed/github/reduxjs/redux/tree/master/examples/todos-flow"sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>

This is like the previous Todos examples, but shows how to use Redux in conjunction with [Flow](https://flow.org/).

## TodoMVC

Run the [TodoMVC](https://github.com/reduxjs/redux/tree/master/examples/todomvc) example:

```sh
git clone https://github.com/reduxjs/redux.git

cd redux/examples/todomvc
npm install
npm start
```

Or check out the [sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/todomvc):

<iframe class="codesandbox"src="https://codesandbox.io/embed/github/reduxjs/redux/tree/master/examples/todomvc"sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>

This is the classical [TodoMVC](http://todomvc.com/) example. It's here for the sake of comparison, but it covers the same points as the Todos example.

This example includes tests.

## Shopping Cart

Run the [Shopping Cart](https://github.com/reduxjs/redux/tree/master/examples/shopping-cart) example:
Expand Down Expand Up @@ -160,23 +123,33 @@ This example demonstrates rendering a deeply nested tree view and representing i

This example includes tests.

## Async
giacomocerquone marked this conversation as resolved.
Show resolved Hide resolved
## Redux essentials

Run the [Async](https://github.com/reduxjs/redux/tree/master/examples/async) example:
Run the [Redux essentials](https://github.com/reduxjs/redux-essentials-example-app) example:

```sh
git clone https://github.com/reduxjs/redux.git
git clone https://github.com/reduxjs/redux-essentials-example-app.git

cd redux/examples/async
cd redux-essentials-example-app
npm install
npm start
```

Or check out the [sandbox](https://codesandbox.io/s/github/reduxjs/redux/tree/master/examples/async):
<iframe class="codesandbox"src="https://codesandbox.io/embed/github/reduxjs/redux-essentials-example-app/tree/master"sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>

## Redux fundamentals

Run the [Redux essentials](https://github.com/reduxjs/redux-fundamentals-example-app) example:

```sh
git clone https://github.com/reduxjs/redux-fundamentals-example-app.git

<iframe class="codesandbox"src="https://codesandbox.io/embed/github/reduxjs/redux/tree/master/examples/async"sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>
cd redux-essentials-example-app
npm install
npm start
```

This example includes reading from an asynchronous API, fetching data in response to user input, showing loading indicators, caching the response, and invalidating the cache. It uses [Redux Thunk](https://github.com/gaearon/redux-thunk) middleware to encapsulate asynchronous side effects.
<iframe class="codesandbox"src="https://codesandbox.io/embed/github/reduxjs/redux-fundamentals-example-app/tree/master"sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin"></iframe>

## Universal

Expand Down
11 changes: 0 additions & 11 deletions examples/async/.gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions examples/async/README.md

This file was deleted.

Loading