This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var alt = require('../alt') | |
var ChatThreadActionCreators = require('../actions/ChatThreadActionCreators') | |
var ChatServerActionCreators = require('../actions/ChatServerActionCreators') | |
var ChatMessageActionCreators = require('../actions/ChatMessageActionCreators') | |
var ThreadStore = require('../stores/ThreadStore') | |
var ChatMessageDataUtils = require('../utils/ChatMessageDataUtils') | |
var ChatMessageUtils = require('../utils/ChatMessageUtils') | |
function MessageStore() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Actions } from 'flummox'; | |
class MessageActions extends Actions { | |
createMessage(messageContent) { | |
return { | |
content: messageContent, | |
date: Date.now(), | |
}; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<App> | |
<AltContainer store={CustomerStore}> | |
<Customer /> | |
</AltContainer> | |
<section> | |
<h1>Selected Address</h1> | |
<div> | |
<div> | |
<AltContainer store={CustomerStore} inject={{ | |
address: props => props.address |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class XStore { | |
static displayName = 'XStore' | |
constructor() { | |
this.foo = 'bar' | |
this.exportPublicMethods({ | |
getFoo: _ => this.foo | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dispatcher } from 'flux' | |
function isPromise(obj) { | |
return obj && (typeof obj === 'object' || typeof obj === 'function') && | |
typeof obj.then === 'function' | |
} | |
const inject = Math.random().toString(16).substr(2, 7) | |
class Alt { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dispatcher } from 'flux' | |
function isPromise(obj) { | |
return obj && (typeof obj === 'object' || typeof obj === 'function') && | |
typeof obj.then === 'function' | |
} | |
// the minimalest | |
class Alt { | |
constructor() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Alt from './' | |
// the magic sauce | |
import { createTransform } from './utils/frp' | |
// decorator utilities | |
import { createStore, bind } from './utils/decorators' | |
const alt = new Alt() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Alt from './' | |
import { ACTION_KEY } from './lib/symbols/symbols' | |
const alt = new Alt() | |
alt.observe = function (action) { | |
const chain = [] | |
const subscriptions = [] | |
this.dispatcher.register((payload) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Dispatcher } from 'flux' | |
import transmitter from 'transmitter' | |
class Alt { | |
constructor() { | |
this.dispatcher = new Dispatcher() | |
} | |
createActions(model) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react' | |
import Alt from 'alt' | |
import connectToStores from 'alt/utils/connectToStores' | |
const alt = new Alt() | |
const TimelineStore = alt.createStore({ | |
displayName: 'TimelineStore', | |
state: {} |