Skip to content

Conversation

@kjanoudi
Copy link
Contributor

This allows us to use a decorator when connecting the component, as is typically standard in higher order components for ES6. http://asaf.github.io/blog/2015/06/23/extending-behavior-of-react-components-by-es6-decorators/

We're now able to do this:

import Sortable from 'react-sortablejs'

@connect(
    (state) => ({
        ...state.myItems
    })
)
@Sortable({
    ref: 'list',
    model: 'myItems'
})
export default class RestaurantInventoryItems extends React.Component {

...
}

@cheton
Copy link
Collaborator

cheton commented Mar 11, 2016

It looks awesome! Thanks for sharing this.

cheton added a commit that referenced this pull request Mar 11, 2016
Use generator syntax to support decorator
@cheton cheton merged commit 952a39a into SortableJS:master Mar 11, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants