Skip to content

Updated default values handling to one liner#129

Open
git-kamesh wants to merge 1 commit into
alyssaxuu:masterfrom
git-kamesh:patch-1
Open

Updated default values handling to one liner#129
git-kamesh wants to merge 1 commit into
alyssaxuu:masterfrom
git-kamesh:patch-1

Conversation

@git-kamesh

Copy link
Copy Markdown

No description provided.

Comment thread engine/flowy.js
Comment on lines +2 to +7
grab = grab || function() {};
release = release || function() {};
snapping = snapping || function () { true; }
rearrange = rearrange || function () { false; }
spacing_x = typeof spacing_x == undefined ? 20 : spacing_x;
spacing_y = typeof spacing_y == undefined ? 20 : spacing_y;

@Jhoubert Jhoubert Feb 24, 2024

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You code is breaking the normal behavior since is expecting a value, you're missing it, this is a working one-liner.

Suggested change
grab = grab || function() {};
release = release || function() {};
snapping = snapping || function () { true; }
rearrange = rearrange || function () { false; }
spacing_x = typeof spacing_x == undefined ? 20 : spacing_x;
spacing_y = typeof spacing_y == undefined ? 20 : spacing_y;
grab = grab || function() {};
release = release || function() {};
snapping = snapping || function () {return true; }
rearrange = rearrange || function () { return false; }
spacing_x = !spacing_x ? 20 : spacing_x;
spacing_y = !spacing_y ? 80: spacing_y;

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