gabrielguerrero / ngrx-traits

NGRX Traits is a library to help you compose and reuse state logic in your angular app. There is two versions, @ngrx-traits/signals supports ngrx-signals, and @ngrx-traits/{core, common} supports ngrx.
MIT License
44 stars 3 forks source link

WithCalls - OnSuccess function doesn't have the correct types #64

Closed francobasilico closed 2 months ago

francobasilico commented 2 months ago

When using the WithCalls and adding an onSuccess callback to action based on the result, the function doesn't recognized the type

Is it possible to have the type of the callback defined on call:?


  sendInvoiceToShipper: {
        call: () => dataService.action({ id: id() as string }),

        onSuccess: (result) => { <-------- result: any

          if (result.data) {
            console.log(result.data)
          }
        },
        onError: (error) => {
        },
        mapPipe: 'switchMap',
        storeResult: false,
      },
github-actions[bot] commented 2 months ago

:tada: This issue has been resolved in version 17.2.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: