refactor: Creating Medias reducer

This commit is contained in:
Cássio Zen
2016-06-10 00:16:01 -03:00
parent 9275aaec90
commit 1ba98fdb5a
21 changed files with 130 additions and 121 deletions

View File

@ -1,6 +1,6 @@
import yaml from 'js-yaml';
import moment from 'moment';
import ImageProxy from '../valueObjects/ImageProxy';
import MediaProxy from '../valueObjects/MediaProxy';
const MomentType = new yaml.Type('date', {
kind: 'scalar',
@ -17,13 +17,13 @@ const MomentType = new yaml.Type('date', {
const ImageType = new yaml.Type('image', {
kind: 'scalar',
instanceOf: ImageProxy,
instanceOf: MediaProxy,
represent: function(value) {
return `${value.uri}`;
},
resolve: function(value) {
if (value === null) return false;
if (value instanceof ImageProxy) return true;
if (value instanceof MediaProxy) return true;
return false;
}
});