Add instanceIndex alias for instanceID#8912
Conversation
|
@davepagurek I have updated it based on the discussion around
|
perminder-17
left a comment
There was a problem hiding this comment.
Thanks for your work, the basic structure looks fine! I'll take a look and test it soon.
ec6c04c to
dd6bf34
Compare
|
I've fixed the CI failure and pushed an update, the issue was related to TypeScript type generation from the JSDoc annotations. Local |
davepagurek
left a comment
There was a problem hiding this comment.
Looks good overall, just two minor things!
| /** | ||
| * @method instanceID | ||
| * @beta | ||
| * @description |
There was a problem hiding this comment.
Do we want to mark this as @deprecated Prefer using instanceIndex or something similar?
| assert.strictEqual(w, myp5.width); | ||
| }); | ||
|
|
||
| test('instanceIndex is a value and instanceID() is a compatibility alias', () => { |
There was a problem hiding this comment.
Looks like this + the test above are not indented, let's make them match the tests around them
dd6bf34 to
b969838
Compare
Add instanceIndex alias for instanceID
Addresses #8911
Changes
instanceIndexas a value-based API for accessing the current instance index in p5.strandsinstanceID()for backwards compatibilityinstanceIndexas the preferred APIinstanceIndexinstanceIndexis exposed as a property rather than a function, making it feel more consistent with other strands values such aswidth,height, andmouseX. The existinginstanceID()API remains available for compatibility.PR Checklist
npm run lintpasses