I am using The Revealing Module Pattern with JS in an angular application.
Now I am going to migrate it from Javascript to Typescript, but I have no idea how to use this pattern with TS. I have read some other post like the following, but no one of them have the return at the beginning of the function. TypeScript code similar to Revealing Module Pattern structure
angular.module('app.services')
.factory('justAService', justAService);
function justAService() {
return {
a: a
};
var x = {};
function a(){....}
Is it possible to write the return at the top?
Thank you