Skip to content

Commit

Permalink
refactor(examples): inline reverseAndUppercase() in component
Browse files Browse the repository at this point in the history
Signed-off-by: Victor Adossi <vadossi@cosmonic.com>
  • Loading branch information
vados-cosmonic committed Oct 16, 2024
1 parent b1236a9 commit 21be25b
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions examples/components/string-reverse-upper/string-reverse-upper.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@
*/
import { reverseString } from 'example:string-reverse/reverse@0.1.0';

/**
* Represents the implementation of the `reverse-and-uppercase` function in the `reversed-upper` interface
*
* This function makes use of `reverse-string` which is *imported* from another WebAssembly binary.
*/
function reverseAndUppercase(s) {
return reverseString(s).toLocaleUpperCase();
}

/**
* The Javascript export below represents the export of the `reversed-upper` interface,
* which which contains `revup` as it's primary exported function.
*/
export const reversedUpper = {
reverseAndUppercase,
/**
* Represents the implementation of the `reverse-and-uppercase` function in the `reversed-upper` interface
*
* This function makes use of `reverse-string` which is *imported* from another WebAssembly binary.
*/
reverseAndUppercase() {
return reverseString(s).toLocaleUpperCase();
},
};

0 comments on commit 21be25b

Please sign in to comment.