DEV Community

Discussion on: Get Google Home alarms & timers as notifications

Collapse
 
sycx2 profile image
sycx2 • Edited

Hello,

Thanks for your flow, I'm using it but sometimes it didn't work.
It's the line

const cachedItems = flow.get('cachedItems') || new Map();
Enter fullscreen mode Exit fullscreen mode

flow.get() returns an object so the functions Map.set() and Map.forEach() aren't working and the function block stops with an error.

Just change it to e.g.

const cachedItems = new Map(Object.entries(flow.get('cachedItems'))) || new Map();
Enter fullscreen mode Exit fullscreen mode

and it should work. I'll test it further and report back if I still get errors:)

I really appreciate your work