-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add event updater plugin (#349)
- Loading branch information
1 parent
981dc3c
commit 0e81005
Showing
31 changed files
with
360 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
packages/event-recurrence/src/event-updater-plugin.impl.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import PluginBase from '@schedule-x/shared/src/interfaces/plugin.interface' | ||
import { CalendarAppSingleton } from '@schedule-x/shared/src' | ||
import EventsFacade from '@schedule-x/shared/src/utils/stateful/events-facade/events-facade.interface' | ||
import { EventsFacadeImpl } from './util/stateful/events-facade' | ||
import CalendarEventExternal from '@schedule-x/shared/src/interfaces/calendar/calendar-event.interface' | ||
|
||
class EventUpdaterPluginImpl implements PluginBase { | ||
name: string = 'EventUpdaterPlugin' | ||
$app!: CalendarAppSingleton | ||
eventsFacade!: EventsFacade | ||
|
||
init($app: CalendarAppSingleton): void { | ||
this.$app = $app | ||
this.eventsFacade = new EventsFacadeImpl(this.$app) | ||
} | ||
|
||
add(event: CalendarEventExternal): void { | ||
this.eventsFacade.add(event) | ||
} | ||
|
||
update(event: CalendarEventExternal): void { | ||
this.eventsFacade.update(event) | ||
} | ||
|
||
remove(eventId: string): void { | ||
this.eventsFacade.remove(eventId) | ||
} | ||
|
||
get(eventId: string): CalendarEventExternal | undefined { | ||
return this.eventsFacade.get(eventId) | ||
} | ||
|
||
getAll(): CalendarEventExternal[] { | ||
return this.eventsFacade.getAll() | ||
} | ||
|
||
set(events: CalendarEventExternal[]): void { | ||
this.eventsFacade.set(events) | ||
} | ||
} | ||
|
||
export const createEventUpdaterPlugin = (): EventUpdaterPluginImpl => | ||
new EventUpdaterPluginImpl() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
export { createEventRecurrencePlugin } from './event-recurrence-plugin.impl' | ||
export { createEventUpdaterPlugin } from './event-updater-plugin.impl' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"@schedule-x/prettier-config" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
![Schedule-X](https://schedule-x.s3.eu-west-1.amazonaws.com/schedule-x-logo.png) | ||
|
||
# @schedule-x/event-updater | ||
|
||
https://schedule-x.dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
extends: ['@schedule-x/eslint-config'], | ||
} |
Oops, something went wrong.