Skip to content

Commit

Permalink
Update get.js example
Browse files Browse the repository at this point in the history
  • Loading branch information
abumq committed May 9, 2024
1 parent 8df63ef commit 201e5f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion examples/get.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
const { get } = require('../src');
const lodashGet = require('lodash.get');

// get value from the object using lodash.get
// when object is resolved
const get = (objOrPromise, path, defaultVal, options = {}) => fn(o => lodashGet(o, path) || defaultVal, options)(objOrPromise)

const getProfile = async (uid) => ({
name: 'John_' + uid,
Expand Down

0 comments on commit 201e5f7

Please sign in to comment.