How to use mori - 10 common examples

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 / app.js View on Github external
socket.on('start game', function() {
    console.log('START GAME');
    gameState = game.startBoard(gameState);
    console.log('gameState.board:', m.get(gameState, 'board'));
    io.emit('start game', m.toJs(gameState));
    // io.emit('start game', gameState);
  });
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 / hubs.js View on Github external
export const snapshot = (state) => ({
  uport: toJs(state.uport),
  hdwallet: toJs(state.hdwallet)
})
github uport-project / uport-mobile / lib / selectors / hubs.js View on Github external
export const snapshot = (state) => ({
  uport: toJs(state.uport),
  hdwallet: toJs(state.hdwallet)
})

mori

Persistent Data Structures for JavaScript

Unknown
Latest version published 10 years ago

Package Health Score

53 / 100
Full package analysis

Popular mori functions