teleport-lib-js icon indicating copy to clipboard operation
teleport-lib-js copied to clipboard

`use` method is error prone in its current format

Open paulbrie opened this issue 6 years ago • 4 comments

The use of use method is error prone: if you forget to call with wrapped with async/await the libraries are not loaded properly.

Proposal: remove readPluginDefinitionFromUrl from it and make it sync. Keep readPluginDefinitionFromUrl as a standalone method.

paulbrie avatar Jul 24 '18 12:07 paulbrie

Another option would be to have both use and useAsync methods for sync and async operations.

timoftean avatar Jul 25 '18 10:07 timoftean

i agree with removing the possibility of using use with urls, but keep it for useAsync

crissmoldovan avatar Jul 25 '18 11:07 crissmoldovan

@paulbrie, are the discussed APIs already published?

timoftean avatar Aug 06 '18 11:08 timoftean

Not yet. If we all agree on the API updates, we could move forward. @nicutimofte, do you want to take the lead on this?

paulbrie avatar Aug 06 '18 12:08 paulbrie