Fork me on GitHub

quick question, any suggestions/best practices around using 3rd party js libs for API’s (e.g. a login/auth service like Cognito) I’m currently calling say (.signUp ..) from one mutation, and have the then and catch call other mutations, but not sure this is the best approach


@eoliphant so, this isn’t a “best practice” answer because frankly I have no fucking clue (will have to wait for @tony.kay for that one), but it seems to me that it’s preferable to keep I/O out of mutations. You could treat Cognito as a remote, implementing it on the frontend, and passing the auth mutation to it


and then using the standard success/error pessismistic mutation callbacks (or just the ok/error handlers in fulcro 3)


I haven’t actually done this; that’s a totally untested suggestion


@eoliphant totally agree with @hmaurer try to treat side effecting things as remotes. We did the same with for example localstorage


> because frankly I have no fucking clue I can’t stop laughing.. Yeah, doing it in the mutation itself was giving me hives, hence my question. Entirely forgot about custom remotes, will give them a whirl, thanks guys