brett
12/14/2022, 3:22 PMHardAtWork
12/14/2022, 3:32 PMbrett
12/14/2022, 4:19 PMHardAtWork
12/14/2022, 4:22 PMbrett
12/14/2022, 8:02 PMidFromName
supported Jurisdictons, would it confuse anyone that these IDs point to three different objects?
NS.idFromName("foo")
NS.idFromName("foo", {jurisdiction:"eu"})
NS.idFromName("foo", {jurisdiction:"bar"})
And regardless of whether it'd confuse you, do you have a different idea for the API you'd prefer?Skye
12/14/2022, 8:09 PMUnsmart | Tech debt
12/14/2022, 8:31 PMUnsmart | Tech debt
12/14/2022, 8:34 PMNS.idFromName("foo", {jurisdiction:"eu"})
doing NS.idFromName("foo", {jurisdiction:"bar"})
should throw)Skye
12/14/2022, 8:35 PMbrett
12/14/2022, 9:14 PMSkye
12/14/2022, 9:15 PMbrett
12/14/2022, 9:16 PMbrett
12/14/2022, 9:16 PMbrett
12/14/2022, 9:17 PM.idFromName
and .get
onbrett
12/14/2022, 9:18 PMNS.idFromName("foo")
NS.idFromNameWithFlags("foo", {jurisdiction:"eu"})
NS.idFromNameWithFlags("foo", {jurisdiction:"bar"})
Burrito
12/14/2022, 9:21 PMjs
NS.idFromOptions({ name: 'foo' })
NS.idFromOptions({ name: 'foo', jurisdiction: 'eu' })
NS.idFromOptions({ name: 'foo', jurisdiction: 'na' })
Would be less confusion imo, it makes intuitive sense that these are different option objects and thus the ids returned are different and unrelated too.brett
12/14/2022, 9:22 PMSkye
12/14/2022, 9:25 PMzegevlier
12/14/2022, 9:39 PMbrett
12/14/2022, 9:51 PMNS.jurisdiction("eu").idFromName("foo")
Skye
12/14/2022, 9:52 PMSkye
12/14/2022, 9:52 PMErwin
12/15/2022, 12:46 AMNS.idFromOptions({ name: 'foo' })
and NS.idFromOptions({ name: 'foo', jurisdiction: 'eu' })
being different objects than NS.idFromOptions({ name: 'foo', jurisdiction: 'eu' })
and NS.idFromOptions({ name: 'foo', jurisdiction: 'na' })
being different.Erwin
12/15/2022, 12:50 AMNS.jurisdiction("eu").idFromName("foo")
is probably the best solution I have seen so far?Plotzes
12/15/2022, 7:21 AMNS.jurisdiction("eu").idFromName("foo")
is the most clearIsaac McFadyen | YYZ01
12/15/2022, 11:53 AMjs
const eu = NS.jusrisdiction("eu");
const do1 = eu.idFromName("do1");
const do2 = eu.idFromName("do2");
const do3 = eu.idFromName("do3");
brett
12/15/2022, 3:10 PM.get
, so eu.get(euId).fetch(...)
works but eu.get(otherJurisdictionId)
would throwHardAtWork
12/15/2022, 3:20 PMbrett
12/15/2022, 3:21 PM