electricitymaps / bloom-contrib

Making carbon footprint data available to everyone.
https://www.bloomclimate.com
MIT License
434 stars 104 forks source link

Fix 23h for energinet and flat polyfill. #435

Closed pierresegonne closed 3 years ago

pierresegonne commented 3 years ago

Resolves https://github.com/tmrowco/tmrow/issues/3483

corradio commented 3 years ago

I think you can use [].concat(...array):

https://medium.com/@mwalterspieler_31762/es6-flatten-an-multi-dimensional-array-bfc6abb930c

madsnedergaard commented 3 years ago

Is the "flatten" part supposed to be committed? Doesn't seem like it's used anywhere, right?

pierresegonne commented 3 years ago

Found a work around (remembered about the beautiful existence of lodash!) I am currently testing it

The flatten part is a polyfill, .flat is still experimental in JS so sometimes it works, sometimes it does not

pierresegonne commented 3 years ago

@madsnedergaard this will need to be merged before running the integration on production for bloom