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

Add database deregistered event usage to redux #1594

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

arbulu89
Copy link
Contributor

@arbulu89 arbulu89 commented Jul 5, 2023

Description

Listen to datatabase_deregistered event, it was missing.

@arbulu89 arbulu89 requested review from rtorrero, dottorblaster, CDimonaco and jamie-suse and removed request for dottorblaster July 5, 2023 13:03
@arbulu89 arbulu89 marked this pull request as ready for review July 5, 2023 13:47
@@ -30,6 +30,11 @@ export const databasesListSlice = createSlice({
appendDatabaseInstance: (state, action) => {
state.databaseInstances = [...state.databaseInstances, action.payload];
},
removeDatabase: (state, { payload: { id } }) => {
state.databases = state.databases.filter(
(database) => !(database.id === id)
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a reason to use !(database.id === id) over database.id !== id here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

nope... XD
Yes, i will change it to use your suggestion, it is more naturla

expect(dispatched).toContainEqual(
removeDatabase({
id,
sid,
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look like sid is necessary for removeDatabase(). A minor thing though...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

well, the payload is composed with the sid in the incoming event, so we need to put it, even though we don't use it in the reducer

@arbulu89 arbulu89 merged commit a4b7e9c into main Jul 5, 2023
@arbulu89 arbulu89 deleted the add-database-deregistered-event-redux branch July 5, 2023 15:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants