Enumerate related modules when I execute flow check command.
ServerCommands.CheckCommand.command が呼び出される。
| /* @flow */ | |
| type A = { a: string }; | |
| type B = { b: number }; | |
| type U = A | B; | |
| type I = A & B; | |
| // Union types | |
| ({ a: 'a' }: U); |
| /* @flow */ | |
| type FN = (x: string) => number; | |
| type FS = (x: number) => string; | |
| type F = FN | FS; // Union types | |
| declare var toS: FS; | |
| declare var toN: FN; | |
| declare var toF: F; |
| /* @flow */ | |
| type FN = (x: string) => number; | |
| type FS = (x: number) => string; | |
| type F = FN & FS; // Intersection types | |
| declare var toS: FS; | |
| declare var toN: FN; | |
| declare var toF: F; |
| // From https://github.com/kuy/redux-tower/commit/9619bb7f65f147640ee8e15ecc8d26dae1b537fd#diff-f38699c88139ae09699a6830074a2af5R30 | |
| function takeFromChannels(channels) { | |
| return race( | |
| Object.keys(channels) | |
| .map(name => ([name, channels[name]])) | |
| .reduce((prev, [name, ch]) => ({ ...prev, [name]: take(ch) }), {}) | |
| ); | |
| } |
| const routes = { | |
| '/posts': { | |
| '/:id': function* show({ params: { id } }) { | |
| yield call(loadPost, id); // Wait for loading data | |
| yield PostShow; // Component change | |
| }, | |
| '/:id/edit': [function* edit({ params: { id } }) { | |
| yield call(loadPost, id); // Wait for loading data | |
| yield PostEdit; | |
| }, function* dirtyCheck() { |
| render(( | |
| <Router history={...}> | |
| <Route path="/" component={App}> | |
| <Route path="A" component={PageA} onEnter={/* E-A */} onLeave={/* L-A */} /> | |
| <Route path="B" component={PageB} onEnter={/* E-B */} onLeave={/* L-B */} /> | |
| <Route path="C" onEnter={/* E-C */} onLeave={/* L-C */} /> | |
| </Route> | |
| </Router> | |
| ), document.getElementById('...')) |
| // Borrowed from react-router exmample "Auth Flow" | |
| // https://github.com/ReactTraining/react-router/tree/master/examples/auth-flow | |
| render(( | |
| <Router history={withExampleBasename(browserHistory, __dirname)}> | |
| <Route path="/" component={App}> | |
| <Route path="login" component={Login} /> | |
| <Route path="logout" component={Logout} /> | |
| <Route path="admin" onEnter={requireAuth}> // Route hook | |
| <Route path="about" component={About} onEnter={...} /> // Component hook |
| class EditPage extends React.Component { | |
| handleUpdate() { | |
| const form = ...; | |
| this.props.dispatch(requestUpdate(form)); | |
| this.props.dispatch(change('/posts/update')); | |
| } | |
| // ... | |
| render() { |