title: Select value from state in NGXS by passing it a parameter
body: <p>I have a state which contains JSON as below:</p>
  
  <pre><code>{id: "1", name: "ig1", description: "ig 11"}
  {id: "5", name: "hhh", description: "hhh"}
  {id: "6", name: "ggg", description: "hhh"}
  </code></pre>
  
  <p>I need to select data for id  = 1 from the state array</p>
  
  <p>How can this be done using NGXS state selector </p>
  
  <p>And how can we access it in component? </p>
  
  <hr>
  
  <p>I have below content in state</p>
  
  <p>recipes</p>
  
  <pre><code>0 : {id: "3", name: "Cake", image: "index.jpg", description: "Lorem Ipsum is 
  simply dummy text of the printing a…ldus PageMaker including versions of 
  Lorem Ipsum.", ingredients: "ig 1-1kg,ig 123-4kg"}
  1 : {id: "16", name: "gfdg", image: "Chrysanthemum.jpg", description: 
  "fhfgh", 
  ingredients: "gdfg-4sfhs,ig 1-1kg"}
  2 : {id: "17", name: "hfgh", image: "Jellyfish.jpg", description: "ghgfh", 
  ingredients: "ig 123-5kg,ig 1-3kg"}
  3 :{id: "18", name: "hgj", image: "Koala.jpg", description: "ghjhgj", 
   ingredients: "gdfg-5sfhs"}
  </code></pre>
  
  <p>I want to get data in state for index 1, i.e. {id: "16", name: "gfdg", image: "Chrysanthemum.jpg", description: "fhfgh", ingredients: "gdfg-4sfhs,ig 1-1kg"}</p>
  
  <p>As per your reply I have added below code</p>
  
  <p>In component:</p>
  
  <pre><code>import { RecipeState } from '../../state/recipe.state';
  edit_details :  Observable&lt;string[]&gt;;
  
  editRecipepopup( id ) {
  this.edit_details = this.store.select(RecipeState.findById).pipe(map(filterFn 
  =&gt; filterFn(id)));
  console.log("edit=&gt;",this.edit_details);
  }
  </code></pre>
  
  <p>In state:</p>
  
  <pre><code>@Selector()
  static findById(state: string[]) {
  return (id: string) =&gt; { //&lt;--- Return a function from select
      console.log("id=&gt;"+id);
     return state.filter(s =&gt; s.indexOf(id) &gt; -1);
  };
  }
  </code></pre>
  
  <p>But I do not get the data. Also my id is not logged in console</p>