PolymerLabs/polymer-redux-hn

Name: polymer-redux-hn

Owner: PolymerLabs

Description: null

Created: 2017-11-29 19:55:35.0

Updated: 2018-03-29 07:27:54.0

Pushed: 2018-03-30 18:09:57.0

Homepage: https://polymer-redux-hn.appspot.com/

Size: 776

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Built with pwa?starter?kit

polymer-redux-hn

An experimental Hacker News client built from scratch using Polymer and Redux. Using to explore patterns for routing, lazy-loading elements/reducer/actions, and organizing files.

The app is built using PWA Starter Kit. Using the starter-template as the starting point and the wiki for configuring and personalizing.

screenshot

Features/highlights
Setup
Routing

Client side routing is done by the src/modules/router.js module, which intercept link clicks and dispatches an action to the store. A subset of window.location is stored in the state, and the rest of the app renders based on that state (never on window.location directly). history.pushState is called as a side-effect of the action creator, meaning that window.location won't actually modify when time-travel debugging. popstate events (e.g. browser back) dispatches a different action that just updates the location state without side-effects.

Lazy-loading

Dynamically-loaded elements are loaded as a side-effect by the updateLocation action in src/actions/app.js. These elements may export actions and selectors that are asynchronously used by the updateLocation action for a particular page.

File structure

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.