GithubHelp home page GithubHelp logo

ngankhanh98 / coursebox-angular Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 2.0 22.62 MB

Coursebox webapp using angular

Home Page: https://ngankhanh98.github.io/coursebox-angular/

License: MIT License

JavaScript 1.19% TypeScript 86.40% SCSS 6.29% HTML 6.13%

coursebox-angular's People

Contributors

32penkin avatar alexeykurbako avatar bradoyler avatar budavariam avatar crissty avatar denstrigo avatar dimaatkaev avatar dizco avatar dmytrolitvinov avatar dohoangdinhtien avatar elupanov avatar esadouski avatar hatemhosny avatar hryb avatar ike353 avatar kostyadanovsky avatar lexzhukov avatar louis-7 avatar lugovsky avatar maksim-karatkevich avatar ngankhanh98 avatar nnixaa avatar pickonefish avatar sashaqred avatar siddhant034 avatar tibing-old-email avatar tryshchenko avatar v-ahmetvaliev avatar valentinkononov avatar yggg avatar

Watchers

 avatar  avatar  avatar

coursebox-angular's Issues

๐Ÿ› Maximum call stack size exceeded

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request
  • question about the decisions made in the repository

Issue description

Current behavior:
Infinite loop update state with Observerable.subscribe()
image
image

Related code:

// auth.service.ts
this.user$.subscribe((user) => {
  const resetPwdToken: Partial<Auth> = {
    resetPwdToken: res['resetPwdToken'],
  };
  this.UPDATE_STATE(user.userId, resetPwdToken);
});

Get my-courses suggestions??

Issue type

I'm submitting a ... (check one with "x")

  • bug report
  • feature request
  • question about the decisions made in the repository

Issue description

Current situation:
Currently, we have 2 big modules: pages and auth, each has their own Akita's state:

// auth.ts (state for AuthModule)
export interface Auth {
  username: string;
  fullname: string;
  userId: string;

  token: string;
}

// course.ts (state for PagesModule)
import { Auth } from 'app/auth/state/auth';

export interface Course {
  courseId: string;
  title: string;
  teacher: Auth;
}

Expected behavior:
In route: /attend/my-courses, I expect to see courses created by me. To doing so, auth.userId or auth.username should be retrieve; and course should returns to all course, then querying them both

Solution suggests:

  1. Rewrite an api (GET - /course/{userId}), and maybe install another store state
  2. Find the way to query the expected result from 2 store state using Akita query. In doing this, I found myself being confused about: where to install code properly, in my-courses.component.ts or in state/course.service.ts
    2.1. And do I have the kind of query allowing to use filter based on 2 Observerable (one with auth state, and the other with course state)?

__
Currently, I'm doging my 2nd approach. The above drawbacks are what I faced or am facing with. Besides, I would like to know if these 2 solutions are anti-pattern (because I have no idea).
@dohoangdinhtien

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.