-
Notifications
You must be signed in to change notification settings - Fork 24
Feature/30 add areas tracking functionality #31
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
Feature/30 add areas tracking functionality #31
Conversation
| export interface TrackerProps { | ||
| trackedPromiseInProgress | ||
| export interface ComponentToWrapProps { | ||
| area: string; |
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.
Should be here are optional?
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.
Or the other way around? the other hoc shouldn't be optional? not sure
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.
I see HOC is optional, because in common cases you want use areas, is something that you can ignore
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.
Exactly, in HOC is optional, and the HOC is always feeding the area to "component to wrap" (default area if it's undefined)
| ``` | ||
|
|
||
| ## Sample with areas: | ||
|
|
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.
Explain here what areas and usage sample
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.
Ok, thank you
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.
Done
| @@ -0,0 +1,45 @@ | |||
| // Jest Snapshot v1, https://goo.gl/fbAQLP | |||
|
|
|||
| exports[`trackerHoc should render component with trackedPromiseInProgress equals false and area equals "default" when render promiseTrackerHoc 1`] = ` | |||
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.
Are useful these snaphsots?
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.
Sure, it's the way to know the spec result. Instead of you have to create somethink like we did with karma + enzyme:
...
// Assert
expect(component.html()).toEqual(`
<TestSpinnerComponent
area="default"
>
...
`)If there are any changes in component implementation, we will see changes on this snapshot too
src/constants.js
Outdated
| @@ -0,0 +1 @@ | |||
| export const defaultArea = 'default'; | |||
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.
If this is something internal let's place and ID that could not be duplicated by mistake, somethiing like default-area
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.
Ok, thank you
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.
Done
|
About the samples, got an idea, create two samples on stackblitz They will read from typicode JSON API: https://jsonplaceholder.typicode.com/ On the basic sample let's add a button load: the will load two tables and using react-spinner show a single spinner. On the areas, let's add two load buttons, each of them will trigger only the spinner related with the table(area). Le'ts add this to the main README.md |
|
It's a great idea, but we will need to publish this version to npm before create samples, isn't it? |
Close #30