After converting the state data to base64
format using the Ngxs state management
library, I am saving it. While I can retrieve all data across different tabs, any changes made in one tab do not automatically sync with other tabs. A tab refresh is required for the data to be synchronized. Is there a way to automatically sync the full state across all tabs when a change is made in one tab?
Below is the code snippet from my AppModule
:
@NgModule({
declarations: [
AppComponent,
ReadComponent,
CreateComponent
],
imports: [
BrowserModule,
AppRoutingModule,
NgxsModule.forRoot([
TutorialState
]),
NgxsReduxDevtoolsPluginModule.forRoot(),
NgxsLoggerPluginModule.forRoot(),
NgxsStoragePluginModule.forRoot({
storage: StorageOption.LocalStorage,
serialize: (state) => btoa(JSON.stringify(state)),
deserialize: (state) => JSON.parse(atob(state))
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule {
}