├── web ├── CNAME ├── assets │ └── alt.png ├── .gitignore ├── Gemfile ├── _includes │ ├── guidenav.html │ ├── guidesnav.html │ ├── sidenav.html │ ├── footer.html │ ├── head.html │ └── header.html ├── _layouts │ ├── default.html │ ├── post.html │ ├── docs.html │ ├── guide.html │ └── guides.html ├── scripts │ ├── search.js │ └── createIndex.js ├── blog.html ├── webpack.config.js ├── README.md ├── feed.xml ├── Gemfile.lock ├── _config.yml └── index.html ├── .babelrc ├── .eslintignore ├── examples ├── weathertabs │ ├── .gitignore │ ├── js │ │ ├── alt.js │ │ ├── app.js │ │ ├── actions │ │ │ ├── AppActions.js │ │ │ └── WeatherActions.js │ │ ├── stores │ │ │ ├── WeatherStore.js │ │ │ └── AppStore.js │ │ └── components │ │ │ ├── WeatherTab.jsx │ │ │ └── App.jsx │ ├── images │ │ └── loading.gif │ ├── index.html │ ├── package.json │ ├── README.md │ └── css │ │ └── app.css ├── chat │ ├── .gitignore │ ├── js │ │ ├── alt.js │ │ ├── actions │ │ │ ├── ChatThreadActionCreators.js │ │ │ ├── ChatServerActionCreators.js │ │ │ └── ChatMessageActionCreators.js │ │ ├── utils │ │ │ ├── ChatMessageDataUtils.js │ │ │ ├── ChatMessageUtils.js │ │ │ └── ChatWebAPIUtils.js │ │ ├── stores │ │ │ ├── __tests__ │ │ │ │ └── UnreadThreadStore-test.js │ │ │ ├── UnreadThreadStore.js │ │ │ ├── ThreadStore.js │ │ │ └── MessageStore.js │ │ ├── components │ │ │ ├── ChatApp.react.js │ │ │ ├── MessageListItem.react.js │ │ │ ├── MessageComposer.react.js │ │ │ ├── ThreadListItem.react.js │ │ │ ├── ThreadSection.react.js │ │ │ └── MessageSection.react.js │ │ ├── app.js │ │ └── ChatExampleData.js │ ├── index.html │ ├── README.md │ ├── package.json │ └── css │ │ └── chatapp.css └── todomvc │ ├── .gitignore │ ├── todomvc-common │ ├── bower.json │ ├── bg.png │ └── readme.md │ ├── js │ ├── alt.js │ ├── app.js │ ├── actions │ │ └── TodoActions.js │ ├── components │ │ ├── Header.react.js │ │ ├── MainSection.react.js │ │ ├── TodoApp.react.js │ │ ├── Footer.react.js │ │ ├── TodoTextInput.react.js │ │ └── TodoItem.react.js │ └── stores │ │ └── TodoStore.js │ ├── css │ └── app.css │ ├── index.html │ └── package.json ├── dist └── alt-with-runtime.js ├── AltContainer.js ├── AltNativeContainer.js ├── test ├── helpers │ ├── alt.js │ ├── SampleActions.js │ ├── SaaM.js │ ├── SampleApp2.jsx │ ├── SampleApp.jsx │ └── ReactComponent.js ├── babel │ └── index.js ├── statics-test.js ├── browser │ ├── index.html │ └── index.js ├── store-as-a-module.js ├── stores-get-alt.js ├── async-action-test.js ├── debug-alt-test.js ├── store-transforms-test.js ├── reducer-test.js ├── stores-with-colliding-names.js ├── value-stores-test.js ├── actions-dump-test.js ├── config-set-get-state-test.js ├── listen-to-actions.js ├── testing-utils.js ├── isomorphic-test.js ├── store-model-test.js ├── alt-config-object.js ├── before-and-after-test.js ├── bound-listeners-test.js ├── failed-dispatch-test.js ├── final-store.js ├── alt-manager-util.js ├── functional-tools-test.js ├── atomic-transactions-test.js └── batching-test.js ├── src ├── utils │ ├── debug │ │ ├── alt.js │ │ ├── DebugActions.js │ │ ├── ViewerStore.js │ │ └── AltStore.js │ ├── chromeDebug.js │ ├── makeHot.js │ ├── statics.js │ ├── withAltContext.js │ ├── functions.js │ ├── ImmutableUtil.js │ ├── Debugger.js │ ├── AltIso.js │ ├── atomic.js │ ├── AltTestingUtils.js │ ├── reducers.js │ ├── makeFinalStore.js │ ├── IsomorphicRenderer.js │ ├── fp.js │ ├── StoreExplorer.js │ ├── ActionListeners.js │ ├── TimeTravel.js │ ├── connect.js │ ├── AltManager.js │ ├── decorators.js │ └── connectToStores.js └── alt │ ├── addons.js │ ├── utils │ ├── AltUtils.js │ └── StateFunctions.js │ ├── actions │ └── index.js │ └── store │ └── AltStore.js ├── .npmignore ├── .gitignore ├── .travis.yml ├── .editorconfig ├── mixins ├── IsomorphicMixin.js ├── Subscribe.js ├── ListenerMixin.js ├── FluxyMixin.js ├── ReactStateMagicMixin.js └── AltManagerMixin.js ├── docs ├── prepare.md ├── rollback.md ├── recycle.md ├── takeSnapshot.md ├── flush.md ├── bootstrap.md ├── utils │ └── hotReload.md ├── actions.md ├── stores.md ├── index.md └── errors.md ├── components ├── AltNativeContainer.js └── AltContainer.js ├── dist.config.js ├── dist.min.config.js ├── bower.json ├── guides └── getting-started │ ├── actions.md │ ├── store.md │ ├── view.md │ ├── index.md │ └── wait-for.md ├── CONTRIBUTING.md └── package.json /web/CNAME: -------------------------------------------------------------------------------- 1 | alt.js.org 2 | -------------------------------------------------------------------------------- /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "stage": 0 3 | } -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | src/utils/TimeTravel.js 2 | -------------------------------------------------------------------------------- /examples/weathertabs/.gitignore: -------------------------------------------------------------------------------- 1 | /js/bundle.js 2 | -------------------------------------------------------------------------------- /dist/alt-with-runtime.js: -------------------------------------------------------------------------------- 1 | module.exports = require('../'); 2 | -------------------------------------------------------------------------------- /examples/chat/.gitignore: -------------------------------------------------------------------------------- 1 | /js/bundle.js 2 | /js/bundle.min.js 3 | -------------------------------------------------------------------------------- /examples/todomvc/.gitignore: -------------------------------------------------------------------------------- 1 | /js/bundle.js 2 | /js/bundle.min.js 3 | -------------------------------------------------------------------------------- /AltContainer.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./components/AltContainer.js') 2 | -------------------------------------------------------------------------------- /AltNativeContainer.js: -------------------------------------------------------------------------------- 1 | module.exports = require('./components/AltNativeContainer.js') 2 | -------------------------------------------------------------------------------- /web/assets/alt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/alt/master/web/assets/alt.png -------------------------------------------------------------------------------- /examples/weathertabs/js/alt.js: -------------------------------------------------------------------------------- 1 | var Alt = require('../../../'); 2 | module.exports = new Alt(); 3 | -------------------------------------------------------------------------------- /test/helpers/alt.js: -------------------------------------------------------------------------------- 1 | import Alt from '../../dist/alt-with-runtime' 2 | export default new Alt() 3 | -------------------------------------------------------------------------------- /web/.gitignore: -------------------------------------------------------------------------------- 1 | .sass-cache 2 | .bundle 3 | .ruby-version 4 | _site 5 | docs 6 | guide 7 | guides 8 | -------------------------------------------------------------------------------- /examples/chat/js/alt.js: -------------------------------------------------------------------------------- 1 | var Alt = require('alt') 2 | var alt = new Alt() 3 | 4 | module.exports = alt 5 | -------------------------------------------------------------------------------- /examples/todomvc/todomvc-common/bower.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "todomvc-common", 3 | "version": "0.1.9" 4 | } 5 | -------------------------------------------------------------------------------- /src/utils/debug/alt.js: -------------------------------------------------------------------------------- 1 | import Alt from '../../' 2 | 3 | const alt = new Alt() 4 | 5 | export default alt 6 | -------------------------------------------------------------------------------- /test/helpers/SampleActions.js: -------------------------------------------------------------------------------- 1 | import alt from './alt' 2 | 3 | export default alt.generateActions('fire') 4 | -------------------------------------------------------------------------------- /examples/todomvc/js/alt.js: -------------------------------------------------------------------------------- 1 | var Alt = require('../../../') 2 | var alt = new Alt() 3 | 4 | module.exports = alt 5 | -------------------------------------------------------------------------------- /web/Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | ruby '2.1.2' 3 | 4 | gem 'rake' 5 | gem 'jekyll' 6 | gem 'sass' 7 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | TODO 2 | bower.json 3 | coverage 4 | examples 5 | npm-debug.log 6 | src 7 | test/browser/tests.js 8 | web 9 | -------------------------------------------------------------------------------- /examples/todomvc/todomvc-common/bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/alt/master/examples/todomvc/todomvc-common/bg.png -------------------------------------------------------------------------------- /examples/weathertabs/images/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/variable/alt/master/examples/weathertabs/images/loading.gif -------------------------------------------------------------------------------- /test/babel/index.js: -------------------------------------------------------------------------------- 1 | require('babel-core/external-helpers') 2 | require('babel/register-without-polyfill')({ 3 | stage: 0 4 | }) 5 | -------------------------------------------------------------------------------- /examples/todomvc/todomvc-common/readme.md: -------------------------------------------------------------------------------- 1 | # todomvc-common 2 | 3 | > Bower component for some common utilities we use in every app 4 | 5 | 6 | ## License 7 | 8 | MIT 9 | -------------------------------------------------------------------------------- /test/helpers/SaaM.js: -------------------------------------------------------------------------------- 1 | export const displayName = 'SaaM' 2 | 3 | export const state = 1 4 | 5 | export function reduce(state, payload) { 6 | return state + 1 7 | } 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | TODO 2 | coverage 3 | node_modules 4 | npm-debug.log 5 | test/browser/tests.js 6 | lib 7 | utils/* 8 | flux.js 9 | flux-build.js 10 | flux-build.min.js 11 | -------------------------------------------------------------------------------- /src/utils/chromeDebug.js: -------------------------------------------------------------------------------- 1 | /*global window*/ 2 | export default function chromeDebug(alt) { 3 | if (typeof window !== 'undefined') window['alt.js.org'] = alt 4 | return alt 5 | } 6 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | script: npm run lint && npm run coverage 3 | after_script: cat ./coverage/lcov.info | coveralls 4 | node_js: 5 | - "0.10" 6 | - "0.12" 7 | - iojs-v1.8.1 8 | -------------------------------------------------------------------------------- /web/_includes/guidenav.html: -------------------------------------------------------------------------------- 1 |
{{ page.date | date: "%b %-d, %Y" }}{% if page.author %} • {{ page.author }}{% endif %}{% if page.meta %} • {{ page.meta }}{% endif %}
10 |subscribe via RSS
13 |
Error loading weather data, check location
; 36 | } 37 | 38 | var weather = this.state.weather; 39 | var rawData = null; 40 | var showText = 'Show Raw JSON'; 41 | if (this.state.showRaw) { 42 | rawData ={JSON.stringify(weather, null, 4)};
43 | showText = 'Hide Raw JSON';
44 | }
45 |
46 | return (
47 | A true flux compliant library in a very small size. Actions are fire and forget, stores have no setters, you get constants, and Flux's single dispatcher.
28 |Alt comes with support for building Isomorphic JavaScript applications right out of the box.
32 |At any point in time you can take a snapshot of the entire application state and then reload it later. This opens the door for easier debugging, hot state reloading, and more.
36 |Do away with defining constants, building your own boilerplate dispatchers, and ugly switch statements.
45 |Feel like ditching singletons, creating instances of each store, and passing them to your view? No problem.
49 |Although optional, Alt is meant to work with ES2015 leveraging the new constructs and syntax for something powerful.
53 |47 | This is an example React/Flux/Alt app that shows the use of AltManager, a 48 | utility class for Alt.js. AltManager allows for multiple alt instances which is 49 | necessary to build apps that encapsulates a mini app inside of a large app. In 50 | this example we have a simple weather searcher. Each search you make will 51 | create a new tab which itself is a new Alt instance and has its own internal 52 | store & actions. Whatever you do in the alt instance is persisted even after 53 | you move to another tab. You can delete tabs which will delete that alt instance 54 |
55 | 62 |