dhmit / paris_1970

Fall 2020 Project: This was Paris in 1970
9 stars 5 forks source link

remove getValue helper function in PhotoViewer #255

Open ryaanahmed opened 2 years ago

ryaanahmed commented 2 years ago

There's a function getValue in frontend/components/PhotoViewer.js that takes a dict, looks for a key, and returns a supplied default value if the key is missing.

Looks like the author was trying to get default values for a config dict going -- we can replace a dict of default args, or use the || operator to provide the same basic functionality.

e.g., instead of const className = getValue(config, "className", "");

do this: const className = config.className || "";