feat: hydrate
This commit is contained in:
parent
322ae08eb9
commit
2e68d147b6
|
@ -50,7 +50,7 @@
|
||||||
"@flecks/governor": "1.4.1",
|
"@flecks/governor": "1.4.1",
|
||||||
"@flecks/react": "^1.4.1",
|
"@flecks/react": "^1.4.1",
|
||||||
"@flecks/redis": "1.4.1",
|
"@flecks/redis": "1.4.1",
|
||||||
"@flecks/redux": "1.4.1",
|
"@flecks/redux": "^1.4.1",
|
||||||
"@flecks/repl": "1.4.1",
|
"@flecks/repl": "1.4.1",
|
||||||
"@flecks/server": "1.4.1",
|
"@flecks/server": "1.4.1",
|
||||||
"@flecks/socket": "1.4.1",
|
"@flecks/socket": "1.4.1",
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import {
|
import {
|
||||||
createSelector,
|
createSelector,
|
||||||
createSlice,
|
createSlice,
|
||||||
|
hydrateLocalStorage,
|
||||||
} from '@flecks/redux';
|
} from '@flecks/redux';
|
||||||
|
|
||||||
export const resourceSelector = (state) => state.resource;
|
export const resourceSelector = (state) => state.resource;
|
||||||
|
@ -41,6 +42,12 @@ const slice = createSlice({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
extraReducers: (builder) => {
|
||||||
|
builder.addCase(hydrateLocalStorage, (state, {payload}) => {
|
||||||
|
state.current = currentResourceSelector(payload);
|
||||||
|
state.open = openResourcesSelector(payload);
|
||||||
|
});
|
||||||
|
},
|
||||||
/* eslint-enable no-param-reassign */
|
/* eslint-enable no-param-reassign */
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user