private transactions = new BehaviorSubject([]);
getTransactions(): Observable<ITransaction[]> {
return this.transactions.asObservable();
}
checkTransactionsExist():Observable<boolean> {
return this.getTransactions().pipe(map((results:any) => results.length > 0 ? true));
} // i need to verify if there is data in the transactions array
I encountered an issue, can you please help me rectify it?
https://i.stack.imgur.com/jODDm.png
ERROR:
- Argument of type 'unknown[]' is not assignable to parameter of type 'OperatorFunction<ITransaction[], boolean>'. Type 'unknown[]' provides no match for the signature '(source: Observable<ITransaction[]>): Observable'.
EDIT: I want to confirm if there are any transactions in the behavior subject array and return true if data exists or false otherwise