-
Notifications
You must be signed in to change notification settings - Fork 421
fix: code error on 'extends context' tutorial #683
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
base: main
Are you sure you want to change the base?
Conversation
As stated in [`State`](https://elysiajs.com/patterns/extends-context.html#state) document, it has entrypoint named `store` and doesn't expose any other properties _directly_ under the Context. so it must be `store.count`, instead of `count`, in order to actually reflect the change(`++`) back to the store.
WalkthroughThe State pattern example was updated to use the handler's Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant RouteHandler
participant Store
Client->>RouteHandler: HTTP request
Note over RouteHandler,Store: Handler receives `{ store }`
RouteHandler->>Store: read store.count
RouteHandler->>Store: store.count = store.count + 1
RouteHandler->>Client: respond with store.count
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🪛 markdownlint-cli2 (0.18.1)docs/tutorial/patterns/extends-context/index.md72-72: Hard tabs (MD010, no-hard-tabs) 73-73: Hard tabs (MD010, no-hard-tabs) 75-75: Hard tabs (MD010, no-hard-tabs) Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
docs/tutorial/patterns/extends-context/index.md
(1 hunks)
🧰 Additional context used
🪛 markdownlint-cli2 (0.18.1)
docs/tutorial/patterns/extends-context/index.md
72-72: Hard tabs
Column: 1
(MD010, no-hard-tabs)
73-73: Hard tabs
Column: 1
(MD010, no-hard-tabs)
75-75: Hard tabs
Column: 1
(MD010, no-hard-tabs)
resolves elysiajs#683 (review) ref: elysiajs#683
As stated in
State
document, it has entrypoint namedstore
and doesn't expose any other properties directly under the Context.so it must be
store.count
, instead ofcount
, in order to actually reflect the change(++
) back to the store.Summary by CodeRabbit