-
-
Notifications
You must be signed in to change notification settings - Fork 39
windy-plugin: sync API #345
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -27,6 +27,7 @@ const { emitter: windyPicker } = W.picker; | |
| const windyRootScope = W.rootScope; | ||
| const { singleclick } = W.singleclick; | ||
| const favs = W.userFavs; | ||
| const broadcast = W.broadcast; | ||
|
|
||
| let appContainer: HTMLElement; | ||
| let resizeObserver: ResizeObserver | undefined; | ||
|
|
@@ -103,11 +104,11 @@ export const mountPlugin = (container: HTMLElement) => { | |
| addSubscription(() => windyPicker.off(pickerMovedEventId)); | ||
| } | ||
|
|
||
| const favsChangedEventId = favs.on('favsChanged', () => { | ||
| const favChangedEventId = broadcast.on('favChanged', () => { | ||
| dispatch(pluginSlice.setFavorites(favs.getArray())); | ||
| }); | ||
|
Comment on lines
+107
to
109
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 💡 Verification agent 🧩 Analysis chainVerify the event name change. The event name has changed from 'favsChanged' to 'favChanged'. Please ensure this aligns with the Windy API's event naming convention. Run this script to verify the event name in the Windy API: 🏁 Script executed: #!/bin/bash
# Description: Search for other usages of 'favChanged' and 'favsChanged' events
# to confirm the correct event name
echo "Searching for 'favChanged' event usage:"
rg -A 2 "favChanged"
echo -e "\nSearching for 'favsChanged' event usage:"
rg -A 2 "favsChanged"Length of output: 1055 Action Required: Ensure Consistent Event Naming Across the Codebase The change to use the
|
||
|
|
||
| addSubscription(() => favs.off(favsChangedEventId)); | ||
| addSubscription(() => broadcast.off(favChangedEventId)); | ||
| }; | ||
|
|
||
| // Called when the plugin is opened | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion (code-quality): Prefer object destructuring when accessing and using properties. (
use-object-destructuring)Explanation
Object destructuring can often remove an unnecessary temporary reference, as well as making your code more succinct.From the Airbnb Javascript Style Guide