mirror of
https://github.com/ascribe/onion.git
synced 2024-12-22 09:23:13 +01:00
Use object to construct TransitionModel to improve readability
This commit is contained in:
parent
7d91832d74
commit
d6a9873bd0
@ -113,7 +113,12 @@ let AccordionListItemTableEditions = React.createClass({
|
||||
showExpandOption = true;
|
||||
}
|
||||
|
||||
let transition = new TransitionModel('editions', 'editionId', 'bitcoin_id', (e) => e.stopPropagation() );
|
||||
const transition = new TransitionModel({
|
||||
to: 'editions',
|
||||
queryKey: 'editionId',
|
||||
valueKey: 'bitcoin_id',
|
||||
callback: (e) => e.stopPropagation()
|
||||
});
|
||||
|
||||
const columnList = [
|
||||
new ColumnModel(
|
||||
|
@ -28,7 +28,7 @@ export class ColumnModel {
|
||||
* our selfes, using this TransitionModel.
|
||||
*/
|
||||
export class TransitionModel {
|
||||
constructor(to, queryKey, valueKey, callback) {
|
||||
constructor({ to, queryKey, valueKey, callback }) {
|
||||
this.to = to;
|
||||
this.queryKey = queryKey;
|
||||
this.valueKey = valueKey;
|
||||
@ -38,4 +38,4 @@ export class TransitionModel {
|
||||
toReactRouterLink(queryValue) {
|
||||
return '/' + this.to + '/' + queryValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user