1- "use strict" ;
1+ 'use strict' ;
2+
3+ Object . defineProperty ( exports , "__esModule" , {
4+ value :true
5+ } ) ;
6+ exports . isType = isType ;
7+ exports . default = actionCreatorFactory ;
28function isType ( action , actionCreator ) {
39return action . type === actionCreator . type ;
410}
5- exports . isType = isType ;
6- function actionCreatorFactory ( prefix , defaultIsError ) {
7- if ( defaultIsError === void 0 ) { defaultIsError = function ( p ) { return p instanceof Error ; } ; }
11+ function actionCreatorFactory ( prefix ) {
12+ var defaultIsError = arguments . length > 1 && arguments [ 1 ] !== undefined ?arguments [ 1 ] :function ( p ) {
13+ return p instanceof Error ;
14+ } ;
15+
816var actionTypes = { } ;
9- var base = prefix ?prefix + "/" :"" ;
10- function actionCreator ( type , commonMeta , isError ) {
11- if ( isError === void 0 ) { isError = defaultIsError ; }
17+ var base = prefix ?prefix + '/' :"" ;
18+ function actionCreator ( type , commonMeta ) {
19+ var isError = arguments . length > 2 && arguments [ 2 ] !== undefined ?arguments [ 2 ] :defaultIsError ;
20+
1221var fullType = base + type ;
1322if ( process . env . NODE_ENV !== 'production' ) {
14- if ( actionTypes [ fullType ] )
15- throw new Error ( "Duplicate action type: " + fullType ) ;
23+ if ( actionTypes [ fullType ] ) throw new Error ( 'Duplicate action type: ' + fullType ) ;
1624actionTypes [ fullType ] = true ;
1725}
1826return Object . assign ( function ( payload , meta ) {
1927var action = {
2028type :fullType ,
21- payload :payload ,
29+ payload :payload
2230} ;
2331if ( commonMeta || meta ) {
2432action . meta = Object . assign ( { } , commonMeta , meta ) ;
@@ -32,12 +40,10 @@ function actionCreatorFactory(prefix, defaultIsError) {
3240function asyncActionCreators ( type , commonMeta ) {
3341return {
3442type :base + type ,
35- started :actionCreator ( type + " _STARTED" , commonMeta , false ) ,
36- done :actionCreator ( type + " _DONE" , commonMeta , false ) ,
37- failed :actionCreator ( type + " _FAILED" , commonMeta , true ) ,
43+ started :actionCreator ( type + ' _STARTED' , commonMeta , false ) ,
44+ done :actionCreator ( type + ' _DONE' , commonMeta , false ) ,
45+ failed :actionCreator ( type + ' _FAILED' , commonMeta , true )
3846} ;
3947}
4048return Object . assign ( actionCreator , { async :asyncActionCreators } ) ;
41- }
42- Object . defineProperty ( exports , "__esModule" , { value :true } ) ;
43- exports . default = actionCreatorFactory ;
49+ }