/*
  Makes API calls to fetch caretaker roles.

  However, until there is an API to call, it returns canned data.
*/

export default class CaretakerRolesGateway {

    static allRoles = null;

    static getAll() {
        if(this.allRoles === null) {
            //api call to get roles
            this.allRoles = [
                {id: 1, name: 'Driver', description: 'Gives rides to things'},
                {id: 2, name: 'Coordinator', description: 'Helps coordinate people sign ups'},
                {id: 3, name: 'Groceries', description: 'Picks up groceries'},
                {id: 4, name: 'Active Friend', description: 'Gets focus out and active (eg, walks) during vulnerable times'},
                {id: 5, name: 'Chef', description: 'Cooks food cause yum'}
            ]
        }
        return this.allRoles;
    }
}

@@ -115,29 +115,20 @@
 */%0A%0A
-export default class 
+const create
 Care
@@ -148,16 +148,24 @@
 eway
+ = () =%3E
  %7B%0A%0A    
 stat
@@ -160,22 +160,19 @@
  %7B%0A%0A    
-static
+let
  allRole
@@ -190,23 +190,38 @@
     
-static
+return %7B%0A       
  getAll
+: 
 ()
+ =%3E
  %7B%0A 
@@ -231,16 +231,15 @@
     
+ 
+   
 if(
-this.
 allR
@@ -255,16 +255,20 @@
 null) %7B%0A
+    
         
@@ -307,21 +307,20 @@
         
-this.
+    
 allRoles
@@ -324,16 +324,20 @@
 les = %5B%0A
+    
         
@@ -419,24 +419,28 @@
             
+  
+  
 %7Bid: 2, name
@@ -502,24 +502,28 @@
 sign ups'%7D,%0A
+    
             
@@ -601,24 +601,28 @@
             
+    
 %7Bid: 4, name
@@ -731,24 +731,28 @@
             
+ 
+   
 %7Bid: 5, name
@@ -814,10 +814,18 @@
     
-%5D%0A
+    %5D%0A    
     
@@ -842,20 +842,19 @@
     
+    
 return 
-this.
 allR
@@ -867,8 +867,65 @@
     
-%7D%0A%7D
+    %7D%0A    %7D%0A%7D%0A%0Aexport default createCaretakerRolesGateway();
 %0A

Refactor CaretakerRolesGateway to use factory pattern