title: How to use strategy pattern in nodejs
body: <p>I am making some rest calls in my code based upon the value in a variable. Each of these rest calls takes a different number of parameters but the response remains the same.</p>
  <pre><code>if (type==&quot;Membership&quot;){
      reponse=await claimRepo.findDetailsByMembersip(memberNumber)
  }
  else if (type==&quot;Claim&quot;){
      reponse=await claimRepo.findDetailsByClaim(claimNumber)
  }
  else if (type==&quot;Date&quot;){
      reponse=await claimRepo.findDetailsByDate(date)
  }
  </code></pre>
  <p>Now inside the claimRepo class</p>
  <pre><code>async findDetailsByMembersip(memberNumber){
      const data=requests.get('someurl')//make the call
      return {
          data,
          statusCode
      }
  }
  
  async findDetailsByClaim(claimNumber){
      const data=requests.get('someurl')//make the call
      return {
          data,
          statusCode
      }
  }
  
  async findDetailsByDate(date){
      const data=requests.get('someurl')//make the call
      return {
          data,
          statusCode
      }
  }
  </code></pre>
  <p>Is there a way to get rid of these if-else blocks and implement this using the strategy pattern ?</p>