-
Notifications
You must be signed in to change notification settings - Fork 192
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
feat: SelectTheme component #1300
Conversation
f8cd652
to
9f32fa3
Compare
69d68cd
to
41fe7d3
Compare
Apologies for the multiple updates. Had a minor issue when committing. |
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.
Looks good. Just a couple of questions
"@looker/sdk-node": "^23.4.0", | ||
"@testing-library/react": "^11.2.7", | ||
"@looker/components-test-utils": "^1.5.27", | ||
"react-redux": "^7.2.9", |
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.
needed as a dev dependency because Provider
is used in tests
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.
Looking good! I have minor questions.
5b8b466
to
33f0e36
Compare
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.
Looks reasonable.
I've made some suggestions and perhaps an experiment
import type { InitFactoryAction } from './slice' | ||
|
||
function* initSaga(action: PayloadAction<InitFactoryAction>) { | ||
const { initFactorySuccessAction, setFailureAction } = factoryActions |
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.
You can do this once outside of the saga.
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.
hmm, if I remember correctly I tried this when writing this and it failed because factoryActions
got destructured before the slice was built. I'll try again.
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.
Yep, I get this:
TypeError: Cannot destructure property 'initAction' of '_slice.themeActions' as it is undefined.
36 |
37 | const {
> 38 | initAction,
| ^
39 | loadThemeDataAction,
40 | getThemesAction,
41 | getDefaultThemeAction
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'm not seeing this when I try it in GlobalStore
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.
Not seeing it in theme sagas either
} | ||
|
||
export function* saga() { | ||
const { initFactoryAction } = factoryActions |
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.
You can extract the actions outside of the saga and just do it once.
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'm not seeing your issue
export const store = createStore({ | ||
preloadedState: { | ||
factory: defaultFactoryState, | ||
themes: defaultThemesState, |
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'd like to see an experiment were the store is created empty and the slices are added dynamically.
I suspect it wont work because of the deep combine issue causing a re-render but I'd like to see what happens.
If this works, this would allow the developer to only load the slices they need
33f0e36
to
8bdd542
Compare
if (service.expired()) { | ||
yield* call(getThemesSaga) | ||
yield* call(getDefaultThemeSaga) | ||
} |
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.
@bryans99 are you ok with me reusing the other two sagas from this saga?
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.
Why not put the action that triggers it. This will block
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, I could do that
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 changed it to call the actions (not put, as I want it to block).
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.
LGTM
5486cef
to
ac252f3
Compare
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.
lgtm
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.
LGTM
No description provided.