GithubHelp home page GithubHelp logo

softuni-angular's People

Contributors

iliaidakiev avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

softuni-angular's Issues

Delete Comment

Ако искаме да изтрием коментар към конкретен пост, при натискане на delete button на този коментар във функцията deleteComment() в компонента извикваме отново loadComments(), която трябва да диспачне getAllComments action и т.н., и като резултат да се заредят всички коментари без този, който сме изтрили. Като рендерирания компонент вече е заредил коментарите за поста, преди да решим да изтрием някой.
Проблема е, че след като компонента се е рендерирал и се е извикала loadComments() веднъж, натискайки delete button се диспачват delete actions, loadComments() не се вика повече и не се диспачва нищо след deleteCommentSuccess action.
Кой е правилният начин да заредим отново коментарите, диспачвайки loadComments actions след изтрития коментар?

Кеширане на данни с ngrx store

Кой е правилният начин за кеширане на данни в store? Трябва ли да имаме допълнипелно пропърти в state-а, например cacheSomething? Или след request-а правим нещо с този Observable, използвайки някой от rxjs операторите?

TS Error in ngrx/effects

Поопражнявам се на един стар проект, но ми дава следната да я наречем 'грешка' в effect-а. Мисля, че ще ми е нужна малко помощ да оправя това:
TS2322: Type ‘{ error: any; } & TypedAction’ is not assignable to tape ‘ObservableInput’.
Property ‘[Symbol.iterator]’ is missing in type ‘{ error: any; } & TypedAction’ but required in type ‘Iterable’.
lib.es2015.iterable.d.ts(51, 5): ‘[Symbol.iterator]’ is declared here. catchError.d.ts(3, 81): The expected type comes from the return type of this signature.

или

TS2322: Type ‘Observable’ is not assignable to type ‘Observable | ((…args: any[]) => Observable)’. Type ‘Observable’ is not assignable to type ‘Observable’.
Property ‘type’ is missing in type ‘{}’ but required in type ‘Action’.
models.d.ts(2, 5): ‘type’ is declared here. effect_creator.d.ts(40, 198): The expected type comes from the return type of this signature.

Това ми е effect-а:
register$ = createEffect(() => this.actions$.pipe( ofType(AuthActions.register), switchMap((data) => this.authService.signUp(data).pipe( map(() => AuthActions.registerSuccess ), tap(() => this.router.navigate(['/login'])), catchError((err) => AuthActions.registerFailed({ error: err.error })) )) ));

А това action-a:
export const register = createAction( ActionTypes.Register, props<{ username: string, password: string }>() ); export const registerSuccess = createAction( ActionTypes.RegisterSuccess, props() ); export const registerFailed = createAction( ActionTypes.RegisterFailed, props<{ error: any }>() );

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.