Open ubershmekel opened 5 years ago
Why are
options
anddata
separate?
Because they apply to different things.
The data
is used to generate the calendar links. Different types of calendars can be added later. There could for example be a calendar for 'zoom invite' one day. These calendars need not be aware of the 'options'.
The options
are used to decide how and where these calendars should be generated. Different types of options could be added later. There could for example be an option called 'style' one day, to get a dark and a light version. These options need not be aware of the 'data'.
can options and data be merged?
Curious - why do you want this ?
It seems tedious to have two objects as input instead of one. Just more API surface to learn. Many JS functions cram every single option and data into one object. It's especially nicer when the objects are big, so indentation doesn't get awkward with two multiline objects in one function call.
But if you prefer to keep them separate, do your thing.
If we're breaking compatibility - can
options
anddata
be merged?https://github.com/carlsednaoui/add-to-calendar-buttons/pull/33