Hello! I was wondering out I can override a namespace or what would be the idiomatic approach for extending a module. For instance, I want to add methods to the Promise module. I created a new file with the name Promise and tried to include Promise but it doesn’t seem to work.
// Promise.res
include Promise
let foo = ...
// App.res
Promise.foo()
That’s because Promise got inferred to be your own module. So you’re getting a cyclic reference error (right?)
Name your file Promise2 or something. Btw, generally speaking, we don’t recommend using include, nor wrapping and re-export. The story here isn’t as good as e.g. Swift’s.