get
Returns a single record's data from the store.
Store.get( params )
Returns a single record's data from the store.
import {QueryLogic, fixture} from "can";
const todoStore = fixture.store( [
{id: 1, name: "Do the dishes"},
{id: 2, name: "Walk the dog"}
], new QueryLogic({identity: ["id"]}) );
const result = todoStore.get( {id: 1} );
console.log( result ); //-> {id: 1, name: "Do the dishes"}
Parameters
- params
{Object}
:An object containing a QueryLogic schema identity of the store.
Returns
{Object}
:
The first record that matches the params.