Category : angular-akita

My original code is difficult to debug and maintain, so I’m rewriting my code. Original Code this.userService.getLocationId(id).subscribe( (locationId) => { this.userService.getUserParams(locationId).subscribe( (params) => { // This API would store users to Akita Store this.userService.getUsers(params).subscribe() // Get data from Akita Store this.users$.subscribe( (users) => { this.users = […users] this.userService.putSomeUserFirst().subscribe( (data) => { if (data === true) ..

Read more

I’m using Akita entity data stores to cache data on the front end of an Angular application. In my service I have some functions something like this: setPropertyOfEntity(entityId, newValue): void { store.update(entityId, {propertyName: newValue}); this.saveEntity(store.getEntity(entityId)); } saveEntity(entity) { httpClient.put(url, entity).subscribe((savedEntity) -> { store.upsert(savedEntity.id, savedEntity) }); } Now, understandably, the Akita store kicks out a whole ..

Read more

I am trying to implement Akita entity store. But while the application will run, I cannot get the store to work and I get an error in the console when it tries to start the component. My error: ERROR Error: This constructor was not compatible with Dependency Injection. More Info: invalidFactory Angular     Store_Factory datorama-akita.js:1101     ProductsStore_Factory ..

Read more

I have an angular frontend from which I access an asmx webservice. The respective class is marked as ScriptService and is generally able to return JSON (Post-request, Get will always return XML even with the respective ScriptMethod attributes (and empty body instead of null if no params)). Generally this works, but I’m not exactly getting ..

Read more

I am looking for any working example where I can save the search filter state after a click on the detail page and coming back to using the location.back() function. I am using the Akita store in my application to maintain the state. I was going through one of the AkitaFilter plugins but they are ..

Read more

I have an Akita state set up… import { PhotosRootObject } from ‘../Interfaces/photos.int’; import { SearchRootObject } from ‘../Interfaces/search.photos.int’; export interface SessionState { data: PhotosRootObject[]; searchData: SearchRootObject; } export function createInitialState(): SessionState { return { data: null, searchData: null }; } @Injectable({ providedIn: ‘root’ }) @StoreConfig({ name: ‘session’ }) export class SessionStore extends Store<SessionState> { ..

Read more