Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Commit

Permalink
fix(actions): fix awral config
Browse files Browse the repository at this point in the history
fix(actions): fix awral config
  • Loading branch information
Metnew committed Dec 5, 2017
1 parent f471a58 commit e729bee
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/common/actions/utils/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @flow
import Awral from 'awral'
import Awral from './awral'
/**
* `parseJSON()` adds property "ok"
* that identicates that response is OK
Expand All @@ -10,12 +10,11 @@ import Awral from 'awral'
* @return {Boolean} - indicates was request successful or not
*/
const check = (result: Object = {ok: false}): boolean => result.ok
const beforeCheck = a => a
const afterCheck = a => a.data
// see ./awral
const failBeforePending = null
const transformResult = a => a.data
// disable dispatch of *_FINALLY actions
const finallyAction = null
// disable dispatch of *_BEFORE_PENDING actions
const beforePending = null

/**
Create default Awral
Expand All @@ -25,4 +24,4 @@ const beforePending = null
Awral is 910 bytes gzipped!
{@link https://github.com/Metnew/awral}
*/
export const awral = Awral.of({check, beforeCheck, afterCheck, finally: finallyAction, beforePending})
export const awral = Awral.of({check, failBeforePending, transformResult, finally: finallyAction})

0 comments on commit e729bee

Please sign in to comment.