mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2026-01-02 02:02:43 +00:00
move callIfExists to base file scope
This commit is contained in:
@@ -15,6 +15,12 @@ const SYSTEMS = ['5e', '4e', '3.5e', 'Pathfinder'];
|
|||||||
|
|
||||||
const homebreweryThumbnail = require('../../thumbnail.png');
|
const homebreweryThumbnail = require('../../thumbnail.png');
|
||||||
|
|
||||||
|
const callIfExists = (val, fn, ...args)=>{
|
||||||
|
if(val[fn]) {
|
||||||
|
val[fn](...args);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const MetadataEditor = createClass({
|
const MetadataEditor = createClass({
|
||||||
displayName : 'MetadataEditor',
|
displayName : 'MetadataEditor',
|
||||||
getDefaultProps : function() {
|
getDefaultProps : function() {
|
||||||
@@ -53,12 +59,6 @@ const MetadataEditor = createClass({
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleFieldChange : function(name, e){
|
handleFieldChange : function(name, e){
|
||||||
const callIfExists = (val, fn, ...args)=>{
|
|
||||||
if(val[fn]) {
|
|
||||||
val[fn](...args);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
callIfExists(e, 'persist');
|
callIfExists(e, 'persist');
|
||||||
|
|
||||||
// load validation rules, and check input value against them
|
// load validation rules, and check input value against them
|
||||||
|
|||||||
Reference in New Issue
Block a user