coderello / laravel-shared-data

📦 An easy way to share the data from your backend to the JavaScript.
https://coderello.com/docs/laravel-shared-data/1.0/sharing-data
MIT License
321 stars 22 forks source link

Refactor `SharedData` configuration #6

Closed klimov-paul closed 5 years ago

klimov-paul commented 5 years ago

Instead of storing entire $config array as internal property, configuration parameters are better to be split via particular fields. Especially, while there is only one configuration parameter - 'js_namespace'.

This refactoring creates more clean code and allows easy creation of standalone SharedData instance if necessary.

Attention: this is BC break change!

hivokas commented 5 years ago

Should we maybe move the logic from constructor to hydrateConfig method?

klimov-paul commented 5 years ago

Should we maybe move the logic from constructor to hydrateConfig method?

I am unsure what it is.