Skip to content

Creating a struct to hold the RRule and allow composition #5

@tlvenn

Description

@tlvenn

Sorry in advance for creating many issues for you... ;)

Right now the provided API is very adhoc, there is mainly 2 entry points depending if you need a stream or not and there is no struct being used to capture the RRule.

I was wondering if the api could evolve in a way where the starting point is the creation of that struct which then can be piped into functions such as:

rrule = RecurringEvents.new(~D[2016-12-07], %{freq: :daily})

RecurringEvents.all(rrule)
RecurringEvents.between(rrule, from, until)
RecurringEvents.take(rrule, 2)
RecurringEvents.to_string(rrule)

of course it would allow composition such as:

RecurringEvents.new(~D[2016-12-07], %{freq: :daily})
|> between(from, until)
|> take(2)

What do you think ?

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions