-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(RelativeRotary): added support for the relative_rotary resource
Signed-off-by: s222em <sem.roeten@gmail.com>
- Loading branch information
Showing
28 changed files
with
458 additions
and
329 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { Hue } from '../hue/Hue'; | ||
import { Events } from '../hue/HueEvents'; | ||
import { SSEResource } from '../types/sse'; | ||
|
||
export function relativeRotaryAdd(data: SSEResource, hue: Hue) { | ||
const relativeRotary = hue.relativeRotaries._add(data); | ||
|
||
return () => hue.emit(Events.RelativeRotaryAdd, relativeRotary); | ||
} | ||
|
||
export function relativeRotaryUpdate(data: SSEResource, hue: Hue) { | ||
const relativeRotary = hue.relativeRotaries.cache.get(data.id); | ||
if (!relativeRotary) return; | ||
|
||
const clone = relativeRotary._update(data); | ||
|
||
return () => hue.emit(Events.RelativeRotaryUpdate, relativeRotary, clone); | ||
} | ||
|
||
export function relativeRotaryDelete(data: SSEResource, hue: Hue) { | ||
const relativeRotary = hue.relativeRotaries.cache.get(data.id); | ||
if (!relativeRotary) return; | ||
|
||
const clone = relativeRotary._clone(); | ||
|
||
hue.relativeRotaries.cache.delete(data.id); | ||
|
||
return () => hue.emit(Events.RelativeRotaryDelete, clone); | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { ResourceManager } from './ResourceManager'; | ||
import { APIResourceType } from '../types/api'; | ||
import { RelativeRotary } from '../structures/RelativeRotary'; | ||
|
||
/** | ||
* Manages the relative_rotary resource | ||
*/ | ||
export class RelativeRotaryManager extends ResourceManager<RelativeRotary> { | ||
type = APIResourceType.RelativeRotary; | ||
holds = RelativeRotary; | ||
} |
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
Oops, something went wrong.