withScope types are hard to use
mrjackdavis opened this issue · 2 comments
mrjackdavis commented
Consider the following scenario
type SomeType = {};
const myScope = createScope<SomeType | undefined>(undefined);
// ...
const myScopeThing:SomeType = {};
const myThing = useMolecule(someMolecule,{
withScope:[myScope,myScopeThing]
})
withScope:[myScope,myScopeThing]
throws an error due to the type of ScopeTuple. The first entry of the tuple is expected to be MoleculeScope<SomeType>
but is in fact MoleculeScope<SomeType | undefined>
.
I would expect this code to work
loganvolkers commented
Thanks for this feedback! I'll try incorporating this into the next version.
Sorry for the slow response.
loganvolkers commented
Addressed in #12