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 configuration
Browse files Browse the repository at this point in the history
fix(actions): fix Awral configuration
  • Loading branch information
Metnew committed Dec 3, 2017
1 parent 9e34091 commit 7344e04
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 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,19 +10,15 @@ 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
const failBeforePending = a => a
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
Awral is not recommended for production usage now
But it can make your work with actions even simpler.
NOTE: I strongly recommend you check Awral sources!
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 7344e04

Please sign in to comment.