figma-plugin
figma-plugin copied to clipboard
Consolidate `createLocalVariables` functions into one
Having two different files called updateVariables
is a little confusing.
controller.ts
-> asyncHandlers.updateVariables
– this is a different function to updateVariables
which is called in createLocalVariablesInPlugin.ts
.
controller.ts
-> asyncHandlers.createLocalVariables
asyncMessageHandlers/createLocalVariables.ts
-> createLocalVariablesInPlugin(...)
createLocalVariablesInPlugin.ts
-> updateVariables
In a future refactor it could be worth reducing the number of functions re message handling and reuse more code. Moving between many different files/functions makes it harder to track the data flow.
Originally posted by @macintoshhelper in https://github.com/tokens-studio/figma-plugin/pull/2568#discussion_r1611720464