How to use the mori.get function in mori

To help you get started, we’ve selected a few mori examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uport-project / uport-mobile / lib / selectors / attestations.js View on Github external
(summary, att) => {
        // TODO this only deals with a single entry claims map. It should handle multiples
        const claim = get(att, 'claim')
        const claimType = first(keys(claim))
        return updateIn(summary, [claimType, get(claim, claimType)], inc)
      },
      sortedMap(),
github uport-project / uport-mobile / lib / selectors / attestations.js View on Github external
(summary, att) => {
        // TODO this only deals with a single entry claims map. It should handle multiples
        const claim = get(att, 'claim')
        const claimType = first(keys(claim))
        return updateIn(summary, [claimType, get(claim, claimType)], inc)
      },
      sortedMap(),
github vakila / net-set / game.js View on Github external
function discard(oldState, card) {
    var cardID = m.get(card, 'id');
    console.log("discarding card", cardID);

    var slotCardPair = m.nth(m.filter(function(slotCard) {
        return m.nth(slotCard, 1) === cardID;
    }, m.get(oldState, 'board')), 0);
    var slotID = m.nth(slotCardPair, 0);
    console.log("card was in slot", slotID);


    return m.assocIn(oldState, ['board', slotID], null);
}
github vakila / net-set / game.js View on Github external
function discard(oldState, card) {
    var cardID = m.get(card, 'id');
    console.log("discarding card", cardID);

    var slotCardPair = m.nth(m.filter(function(slotCard) {
        return m.nth(slotCard, 1) === cardID;
    }, m.get(oldState, 'board')), 0);
    var slotID = m.nth(slotCardPair, 0);
    console.log("card was in slot", slotID);


    return m.assocIn(oldState, ['board', slotID], null);
}
github vakila / net-set / game.js View on Github external
function downsizeIfNeeded(oldState) {
    var oldBoard = m.get(oldState, 'board');
    console.log("board:", sortBoard(oldBoard));
    if (needsDownsize(oldBoard)) {
        console.log('needs downsize!');
        return m.assoc(oldState, 'board', downsizeBoard(oldBoard));
    } else {
        console.log('no downsize needed');
        return oldState;
    }
}
github uport-project / uport-mobile / lib / selectors / identities.js View on Github external
(identity, subaccounts) =>
    toJs(
      concat(!get(identity, 'address') || get(identity, 'address').match(/^did:/) ? [] : vector(identity), subaccounts),
    ),
)
github uport-project / uport-mobile / lib / selectors / identities.js View on Github external
  (selected, accounts) => filter(acct => get(acct, 'parent') === selected, accounts),
)
github vakila / net-set / game.js View on Github external
function deal(oldState, slotID) {
    var oldBoard = m.get(oldState, 'board');
    var oldToDeal = m.get(oldState, 'toDeal');

    var newBoard = m.assoc(oldBoard, slotID, m.peek(oldToDeal));
    var newToDeal = m.pop(oldToDeal);

    return m.pipeline(oldState,
        m.curry(m.assoc, 'board', newBoard),
        m.curry(m.assoc, 'toDeal', newToDeal)
    );
}
github petehunt / morimodel / src / JSONMoriModel.js View on Github external
return mori.reduce(function(accum, key) {
    accum[key] = mori.get(hashMap, key);
    return accum;
  }, {}, mori.keys(hashMap));
}

mori

Persistent Data Structures for JavaScript

Unknown
Latest version published 9 years ago

Package Health Score

53 / 100
Full package analysis

Popular mori functions