silverstripe / silverstripe-asset-admin

Silverstripe assets gallery for asset management
BSD 3-Clause "New" or "Revised" License
20 stars 79 forks source link

General feedback #16

Closed unclecheese closed 9 years ago

unclecheese commented 9 years ago

High level stuff

createFolder: (data) {
    galleryDispatcher.dispatch({
        action: CONSTANTS.ITEM_STORE.CREATE,
        type: CONSTANTS.VIEW_ACTION,
        data: { title: 'New folder' },
        silent: silent
    });
    API.post('/folder/', data)
       .then(response => {
            galleryDispatcher.dispatch({
                action: CONSTANTS.ITEM_STORE.CREATE,
                type: CONSTANTS.SERVER_ACTION,
                data: response.body,
                silent: silent
            });
        });        
}

This definitely starts to get verbose, and I would recommend creating some factories to generate these actions.

Minor bits

static propTypes = { 

}

over MyClass.PropTypes = {}

and

myEventHandler = (e) => {

}

over this.myEventHandler = this.myEventHandler.bind(this);

flashbackzoo commented 9 years ago

Awesome - thanks for reviewing this!