layout | title | description | tags | ||
---|---|---|---|---|---|
default |
SQL Style Guide |
A guide to writing clean, clear, and consistent SQL. |
|
import React from 'react'; | |
import { render } from 'react-dom'; | |
import Root from './components/root.jsx'; | |
import { silentSwap } from './lib/atom'; | |
import { fromJS } from 'immutable'; | |
import './stores/ui'; | |
const initialState = { | |
ui: { |
In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.
At the moment GraphQL allows 2 types of queries:
query
mutation
Reference implementation also adds the third type: subscription
. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.
import React from 'react'; | |
/** | |
* Counter.js | |
* | |
* exposes: | |
* init | |
* update | |
* view | |
*/ |
# Makefile for web development with: | |
# 1. ES6 / Babel compiler | |
# setup: npm install babel | |
# 2. Bundler (Webpack or Browserify) | |
# setup: npm install webpack|browserify | |
# 3. Static Web Server | |
# setup: npm install http-server | |
WEBMAKE = webmake | |
WEBPACK = webpack |
f(events) -> state | |
match f(state, event) -> state | |
f(state, command) -> events |
Reposted from Qiita
For almost a year now, I've been using this "flux" architecture to organize my React applications and to work on other people's projects, and its popularity has grown quite a lot, to the point where it shows up on job listings for React and a lot of people get confused about what it is.
There are a billion explainations on the internet, so I'll skip explaining the parts. Instead, let's cut to the chase -- the main parts I hate about flux are the Dispatcher and the Store's own updating mechanism.
If you use a setup similar to the examples in facebook/flux, and you use flux.Dispatcher, you probably have this kind of flow:
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv='Content-type' content='text/html; charset=utf-8'> | |
<title>Basic Example with JSX</title> | |
<link rel="stylesheet" href="base.css" /> | |
</head> | |
<body> | |
<h1>ReactJs + RxJs</h1> | |
<div id="container"> |
@import "../../../../vendor/angular-ui-grid-src/src/less/grid"; | |
@import "../../../../vendor/angular-ui-grid-src/src/less/header"; | |
@import "../../../../vendor/angular-ui-grid-src/src/less/body"; | |
@import "../../../../vendor/angular-ui-grid-src/src/less/cell"; | |
@import "../../../../vendor/angular-ui-grid-src/src/less/native-scrollbar"; | |
@import "../../../../vendor/angular-ui-grid-src/src/less/footer"; | |
@import "../../../../vendor/angular-ui-grid-src/src/less/menu"; | |
@import "../../../../vendor/angular-ui-grid-src/src/less/sorting"; | |
@import "../../../../vendor/angular-ui-grid-src/src/less/icons"; | |
@import "../../../../vendor/angular-ui-grid-src/src/less/rtl"; |
This document is a collection of concepts and strategies to make large Elm projects modular and extensible.
We will start by thinking about the structure of signals in our program. Broadly speaking, your application state should live in one big foldp
. You will probably merge
a bunch of input signals into a single stream of updates. This sounds a bit crazy at first, but it is in the same ballpark as Om or Facebook's Flux. There are a couple major benefits to having a centralized home for your application state:
- There is a single source of truth. Traditional approaches force you to write a decent amount of custom and error prone code to synchronize state between many different stateful components. (The state of this widget needs to be synced with the application state, which needs to be synced with some other widget, etc.) By placing all of your state in one location, you eliminate an entire class of bugs in which two components get into inconsistent states. We also think yo