This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Entity({ | |
tableName: 'folders', | |
}) | |
export class FolderEntity { | |
@ManyToMany({ | |
entity: () => Project, | |
pivotEntity: () => VisionProjectsFolderEntity, | |
joinColumn: 'folder__id', // this property is important to provide, it is the column where we will go and query the pivot table | |
}) | |
projects = new Collection<Project>(this); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Component { | |
constructor(private service: Service) {} | |
handleClick$ = new Subject(); | |
ngOnInit() { | |
this.handleClick$.pipe( | |
switchMap(() => { | |
return this.service.someObservable$; | |
}) | |
).subscribe(console.log); | |
// this observable would stop firing as soon as there is an error, subsequent button clicks will not trigger it. |