styd / apexcharts.rb

:bar_chart: Awesome charts for your ruby app powered by ApexCharts.JS.
https://a-styd.gitbook.io/apexcharts-ruby/
MIT License
481 stars 29 forks source link

Deprecate local palette #61

Closed styd closed 4 years ago

styd commented 4 years ago

Local or ephemeral palette doesn't seem useful. People can just create multiple global palettes and use them on conditions.

Besides, using fiber-local or even thread-local can have unexpected results on a site with busy traffic and server with connection thread pool. For example, if someone to check first whether Theme::Local.palettes[:a_palette_name] exists or not before invoking create_palette and decided not to create the palette if exists (for some crazy reason), he/she will use the palette defined in the previous request that creates a local palette too. But this case is very unlikely. So the main reason for deprecation is the lack of usefulness.