Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DOCS] Add code example for EmberArray.addArrayObserver #18272

Merged

Conversation

sdebarros
Copy link
Contributor

Part of #18228

@@ -446,6 +446,32 @@ const ArrayMixin = Mixin.create(Enumerable, {
which you can use to override the method names that will be invoked on the
target.

Example:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

YUIDoc supports an @example annotation with a description https://yui.github.io/yuidoc/syntax/index.html. Could you update for that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've moved the example to below an @example tag, let me know if the position is ok.

@sivakumar-kailasam
Copy link
Member

I tried this PR locally & YUIDoc doesn't seem to recognize the @example decorator in this file but the same works on packages/@ember/-internals/metal/lib/tracked.ts#L55. Maybe for now we can stick to adding it to the end of the description.

@sdebarros
Copy link
Contributor Author

@sivakumar-kailasam I ran yarn run docs and this is how I see the docs:
Screen Shot 2019-08-29 at 18 26 38

I couldn't find the docs for the file you mentioned. Do you mind letting me know how you are testing it?

The difference I see is that in that file @example doesn't have something nested, and the code is actually wrapped with backticks, so I think it's not being formatted by @example but the regular way.

Copy link
Member

@sivakumar-kailasam sivakumar-kailasam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried it again & it works as expected now. I must've messed up something the last time I tried this. Thanks again for this PR 🙂

@sivakumar-kailasam sivakumar-kailasam merged commit 3b07114 into emberjs:master Aug 30, 2019
@sdebarros sdebarros deleted the add-addArrayObserver-code-example branch August 30, 2019 13:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants