Created
May 20, 2015 20:03
-
-
Save tmcw/d7e1cda22253c4324bf5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var newUploads = Immutable.fromJS(action.value); | |
// assuming oldUploads is the previous value. | |
var changeWithStates = newUploads.map(newValue => { | |
var oldValue = oldUploads.find(other => other.id === newValue.get('id')); | |
if (oldValue.get('complete') === false && newValue.has('error')) { | |
return newValue.set('status', 'errored'); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment