- bla
- blabla
- bar
gem install blablabla
const falcor = require('falcor'); | |
const Rx = require('rxjs'); | |
//FalcorSubscribableModel | |
module.exports = function(modelOptions) { | |
modelOptions = modelOptions || {}; | |
const self = {}; | |
const modelSubject = new Rx.BehaviorSubject(); |
TasksApp = React.createClass({ | |
// all component state originates from TaskStore, upstream | |
getInitialState: function() { | |
return { | |
selectedTask: TaskStore.selectedTask(), | |
tasks: TaskStore.tasks(), | |
}; | |
}, | |
// and when the TaskStore's state changes, we update this component's |
var gulp = require('gulp'); | |
var webserver = require('gulp-webserver'); | |
var fileInclude = require('gulp-file-include'); | |
/* | |
* Design spec build tasks: | |
* | |
* Compile and serve a design spec (style guide) site. | |
*/ | |
gulp.task('dspec', ['dspec:watch'], function() { |
const Cache = function(deps) { | |
const self = {}; | |
const requested = {}; | |
self.fetch = function(href) { | |
requested[href] = requested[href] || new Promise((resolve, reject) => { | |
const collection = deps.Collection(); | |
collection.fetch(href).done(() => { | |
resolve(collection); | |
}); |
var appliedFilters = {}; | |
function anyFilterApplied() { | |
return Object.keys(appliedFilters).length > 0; | |
} | |
function applyFilter(filter, key) { | |
appliedFilters[key] = filter; | |
} |
class ExcludeXhr | |
def matches?(request) | |
!request.xhr? | |
end | |
end | |
Rails.application.routes.draw do | |
constraints(ExcludeXhr.new) do | |
root 'home#index' # home/index just renders our single page client-side app | |
get '*path', to: "home#index", via: :all |
const BookStore = function(deps) { | |
const self = Coherence(deps); | |
self.handleAction('search-book', searchBook); | |
return self.fluxSafe(); | |
function searchBook(payload) { | |
deps.books.fetch(payload.id).then(function(response) { | |
self.setData('book', response); | |
}) | |
} |
// tired of this extension pattern | |
var Cow = AnimalFactory({ | |
getVoice: function() { return 'moo'; }), | |
numLegs: 4, | |
name: 'Cow', | |
}) | |
// propose this one instead | |
var MutantCow = AnimalFactory.extend() | |
.getVoice(function() { return 'moo'; }) |
// example app initialization | |
$(function() { | |
Dispatcher.dispatch({ | |
type: 'initialize app', | |
path: window.location.pathname, | |
}); | |
}); |