You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `DurableObjectId` interface refers to a new or existing Durable Object instance. This interface is most frequently used by [`DurableObjectNamespace::get`](/durable-objects/api/namespace/#get) to obtain a stub for submitting requests to the Durable Object class.
13
13
14
-
Note that creating an ID for a Durable Object instance does not invoke the constructor of the Durable Object. This is done lazily when calling [`DurableObjectNamespace::get`](/durable-objects/api/namespace/#get) to create a [`DurableObjectStub`](/durable-objects/api/stub) from a `DurableObjectId`. This ensures that objects are not constructed unless their methods can be directly invoked.
14
+
Note that creating an ID for a Durable Object instance does not create the Durable Object. The Durable Objectis created lazily after calling [`DurableObjectNamespace::get`](/durable-objects/api/namespace/#get) to create a [`DurableObjectStub`](/durable-objects/api/stub) from a `DurableObjectId`. This ensures that objects are not constructed until they are actually accessed.
15
15
16
16
:::note[`DurableObjectId`]
17
17
@@ -53,7 +53,7 @@ A 64 digit hex string.
53
53
```js
54
54
constid1=env.MY_DURABLE_OBJECT.newUniqueId();
55
55
constid2=env.MY_DURABLE_OBJECT.newUniqueId();
56
-
console.assert(!id1.equals(id2), "This should always be true");
56
+
console.assert(!id1.equals(id2), "Different unique ids should never be equal.");
57
57
```
58
58
59
59
#### Parameters
@@ -75,8 +75,8 @@ A boolean. True if equal and false otherwise.
75
75
```js
76
76
constid1=env.MY_DURABLE_OBJECT.newUniqueId();
77
77
constid2=env.MY_DURABLE_OBJECT.idFromName("foo");
78
-
console.assert(id1.name===undefined, "This should always be true");
79
-
console.assert(id2.name==="foo", "This should always be true");
78
+
console.assert(id1.name===undefined, "unique ids have no name");
79
+
console.assert(id2.name==="foo", "name matches parameter to idFromName");
0 commit comments