How to use @ndla/util - 2 common examples

To help you get started, we’ve selected a few @ndla/util 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 NDLANO / learningpath-frontend / src / messages / messagesReducer.js View on Github external
action.payload.json.messages.forEach(m => {
            nextState.push({
              id: uuid(),
              message: `${m.field}: ${m.message}`,
              severity: 'danger',
              timeToLive: 0,
            });
          });
        }
github NDLANO / learningpath-frontend / src / reducers / stateUuid.js View on Github external
* This source code is licensed under the GPLv3 license found in the
 * LICENSE file in the root directory of this source tree.
 *
 */

import { handleActions } from 'redux-actions';
import { uuid } from '@ndla/util';

export default handleActions(
  {
    SET_STATE_UUID: {
      next: (state, action) => action.payload,
      throw: state => state,
    },
  },
  uuid(),
);

@ndla/util

Collection of util functions used by NDLA

GPL-3.0
Latest version published 2 months ago

Package Health Score

76 / 100
Full package analysis

Popular @ndla/util functions