Skip to content
This repository was archived by the owner on Aug 26, 2021. It is now read-only.

calvinwoo/flux-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flux-example

A simple "shopping cart" application that serves as a Flux example.

In an effort to keep things simple, no additional Flux related libraries are used, except for the default Dispatcher module provided by Facebook.

Description

The UI contains 2 main components:

  • ShoppingCart: displays a list of cart items and lets users add new items to the cart
  • Notifications: keeps track of how many total items are in the cart

Adding additional items to the cart through the UI will cause this series of events to occur:

  1. Send an update request to the cart API
  2. Optimistically update the Flux store instead of waiting for a successful API response
  3. Publish changes to listeners in the UI compoments

A faux API is implemented using browser localStorage.

Built in ES6 using Babel and Webpack

Usage

npm install
npm start

webpack-dev-server should be running the app on http://localhost:8080/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published