File tree Expand file tree Collapse file tree 8 files changed +52
-9
lines changed Expand file tree Collapse file tree 8 files changed +52
-9
lines changed Original file line number Diff line number Diff line change 11{
22 "plugins" : [
33 " transform-class-properties" ,
4- " transform-runtime"
4+ " transform-runtime" ,
5+ " transform-flow-comments"
56 ],
67 "presets" : [
78 [" es2015" , { "modules" : false }],
Original file line number Diff line number Diff line change 1+ [ignore]
2+
3+ [include]
4+
5+ [libs]
6+
7+ [options]
Original file line number Diff line number Diff line change 3939 "extract-text-webpack-plugin" : " ^2.0.0-rc.2" ,
4040 "fetch-mock" : " ^5.9.3" ,
4141 "file-loader" : " 0.8.5" ,
42+ "flow-babel-webpack-plugin" : " ^1.0.1" ,
4243 "html-webpack-plugin" : " ^2.24.1" ,
4344 "http-server" : " ^0.9.0" ,
4445 "isomorphic-fetch" : " ^2.2.1" ,
Original file line number Diff line number Diff line change 1+ /* @flow */
2+
3+ /**
4+ * Types
5+ */
6+
7+ import type {
8+ Todo
9+ } from "../types" ;
10+
111/**
212 * Actions
313 */
414
5- export const ADD_TODO = 'ADD_TODO' ;
6- export function addTodo ( todo ) {
15+ export const ADD_TODO : string = 'ADD_TODO' ;
16+ export function addTodo ( todo : Todo ) {
717 return {
818 type : ADD_TODO ,
919 payload : todo
1020 } ;
1121}
1222
13- export const ADD_EPIC_TODO = 'ADD_EPIC_TODO' ;
14- export function addEpicTodo ( todo ) {
23+ export const ADD_EPIC_TODO : string = 'ADD_EPIC_TODO' ;
24+ export function addEpicTodo ( todo : Todo ) {
1525 return {
1626 type : ADD_EPIC_TODO ,
1727 payload : todo
1828 } ;
1929}
2030
21- export const ADD_EPIC_HTTP_TODO = 'ADD_EPIC_HTTP_TODO' ;
31+ export const ADD_EPIC_HTTP_TODO : string = 'ADD_EPIC_HTTP_TODO' ;
2232export function addEpicHttpTodo ( ) {
2333 return {
2434 type : ADD_EPIC_HTTP_TODO
2535 } ;
2636}
2737
28- export const DELETE_TODO = 'DELETE_TODO' ;
29- export function deleteTodo ( id ) {
38+ export const DELETE_TODO : string = 'DELETE_TODO' ;
39+ export function deleteTodo ( id : number ) {
3040 return {
3141 type : DELETE_TODO ,
3242 payload : id
Original file line number Diff line number Diff line change 1+ /* @flow */
2+
3+ export type Todo = {
4+ id : string ,
5+ text : string
6+ }
Original file line number Diff line number Diff line change 1+ /* @flow */
2+
3+
4+ export type Todo = {
5+ id : string ,
6+ text : string
7+ }
Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ const webpack = require('webpack');
77const DashboardPlugin = require ( 'webpack-dashboard/plugin' ) ;
88const HtmlWebpackPlugin = require ( 'html-webpack-plugin' ) ;
99const ExtractTextPlugin = require ( 'extract-text-webpack-plugin' ) ;
10+ const FlowBabelWebpackPlugin = require ( 'flow-babel-webpack-plugin' ) ;
1011const autoprefixer = require ( 'autoprefixer' ) ;
1112
1213/**
@@ -59,7 +60,8 @@ const plugins = [
5960 ] ,
6061 context : constants . SOURCE_PATH
6162 }
62- } )
63+ } ) ,
64+ new FlowBabelWebpackPlugin ( )
6365] ;
6466
6567/**
Original file line number Diff line number Diff line change 1+ /**
2+ * Libraries
3+ */
4+
5+ const FlowBabelWebpackPlugin = require ( 'flow-babel-webpack-plugin' ) ;
6+
17/**
28 * Exporting configuration
39 */
410
511module . exports = {
612 devtool : 'source-map' ,
13+ plugins : [
14+ new FlowBabelWebpackPlugin ( ) ,
15+ ] ,
716 module : {
817 rules : [ {
918 test : / \. ( j s | j s x ) $ / ,
You can’t perform that action at this time.
0 commit comments