add-to-calendar-buttons icon indicating copy to clipboard operation
add-to-calendar-buttons copied to clipboard

Why are `options` and `data` separate?

Open ubershmekel opened this issue 6 years ago • 2 comments

If we're breaking compatibility - can options and data be merged?

https://github.com/carlsednaoui/add-to-calendar-buttons/pull/33

ubershmekel avatar Jan 07 '19 00:01 ubershmekel

Why are options and data 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 ?

commonpike avatar May 21 '19 21:05 commonpike

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.

ubershmekel avatar Sep 14 '19 07:09 ubershmekel