Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngrx-forms

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngrx-forms - npm Package Versions

13
6

6.1.0

Diff

Changelog

Source

6.1.0

Features
  • add support for local form states outside of the ngrx store (#166), closes #165, see the user guide for more details, thanks @mucaho for implementing this great feature

<a name="6.0.0"></a>

mrwolfz
published 6.0.0 •

Changelog

Source

6.0.0

This major release contains only a bugfix which is a breaking change.

Breaking Changes
  • do not treat empty strings or arrays as an error in minLength validation function (#164), thanks @Sloff for reporting and fixing this bug

    If you require these values to be treated as errors use minLength together with required (e.g. validate(required, minLength(2)))

<a name="5.2.3"></a>

mrwolfz
published 5.2.3 •

Changelog

Source

5.2.3

Bugfixes
  • use project tsconfig.json with ng-packagr during build; this bug lead to incorrect type definitions (#163), thanks @tomvandezande for reporting and fixing this bug

<a name="5.2.2"></a>

mrwolfz
published 5.2.1 •

Changelog

Source

5.2.1

Bugfixes
  • ensure form states are correctly updated from actions when using onNgrxFormsAction with onNgrxForms (ee5dccf)

<a name="5.2.0"></a>

mrwolfz
published 5.2.0 •

Changelog

Source

5.2.0

Features
  • add function onNgrxFormsAction that allows specifying a reducer for ngrx-forms actions with createReducer from ngrx 8 (5cdf9c6)

    It can be used as follows:

    import { createReducer } from '@ngrx/store';
    import {
      onNgrxForms,
      onNgrxFormsAction,
      SetValueAction,
      updateGroup,
      validate,
      wrapReducerWithFormStateUpdate,
    } from 'ngrx-forms';
    import { required } from 'ngrx-forms/validation';
    
    export interface LoginFormValue {
      username: string;
      password: string;
      stayLoggedIn: boolean;
    }
    
    export const initialLoginFormValue: LoginFormValue = {
      username: '',
      password: '',
      stayLoggedIn: false,
    };
    
    export const validateLoginForm = updateGroup<LoginFormValue>({
      username: validate(required),
      password: validate(required),
    });
    
    const reducer = createReducer(
      {
        loginForm: createFormGroupState('loginForm', initialLoginFormValue),
        // your other properties...
      },
      onNgrxForms(),
    
      // use this to call a reducer for a specific ngrx-forms action;
      // note that this must be placed after onNgrxForms
      onNgrxFormsAction(SetValueAction, (state, action) => {
        if (action.controlId === 'loginForm.username') {
          // react to username changing...
          // action is of type SetValueAction
        }
    
        return state;
      }),
      // your other reducers...
    );
    

<a name="5.1.0"></a>

mrwolfz
published 5.1.0 •

Changelog

Source

5.1.0

Features
  • add functions onNgrxForms and wrapReducerWithFormStateUpdate to allow better integration with createReducer from ngrx 8 (ac95be2), closes #147

    They can be used as follows:

    import { createReducer } from '@ngrx/store';
    import { onNgrxForms, updateGroup, validate, wrapReducerWithFormStateUpdate } from 'ngrx-forms';
    import { required } from 'ngrx-forms/validation';
    
    export interface LoginFormValue {
      username: string;
      password: string;
      stayLoggedIn: boolean;
    }
    
    export const initialLoginFormValue: LoginFormValue = {
      username: '',
      password: '',
      stayLoggedIn: false,
    };
    
    export const validateLoginForm = updateGroup<LoginFormValue>({
      username: validate(required),
      password: validate(required),
    });
    
    const rawReducer = createReducer(
      {
        loginForm: createFormGroupState('loginForm', initialLoginFormValue),
        // your other properties...
      },
      onNgrxForms(),
      // your other reducers...
    );
    
    // wrapReducerWithFormStateUpdate calls the update function
    // after the given reducer; you can wrap this reducer again
    // if you have multiple forms in your state
    export const reducer = wrapReducerWithFormStateUpdate(
      rawReducer,
      // point to the form state to update
      s => s.loginForm,
      // this function is always called after the reducer
      validateLoginForm,
    );
    
  • add update functions for async validations (8985e99)

  • export constant ALL_NGRX_FORMS_ACTION_TYPES that is an array of all action types ngrx-forms provides (09aad36)

Bugfixes
  • allow setting async errors if the validation is not pending (3f5c6d0)
  • allow clearing async errors on groups and arrays if the validation is not pending (ff13472)

<a name="5.0.3"></a>

mrwolfz
published 5.0.3 •

Changelog

Source

5.0.3

Bugfixes
  • remove readonly modifier from array control state value (28e781c), thanks @dzonatan for reporting this bug, closes #155

<a name="5.0.2"></a>

mrwolfz
published 5.0.2 •

Changelog

Source

5.0.2

Bugfixes
  • remove direct reference to Event since that causes errors in NativeScript applications (1ac565a), thanks @bufke for reporting this bug, closes #153

<a name="5.0.1"></a>

mrwolfz
published 5.0.1 •

Changelog

Source

5.0.1

Bugfixes
  • remove any references to UIEvent since that causes errors in NativeScript applications (70cdbc2), thanks @bufke for reporting this bug, closes #153

<a name="5.0.0"></a>

mrwolfz
published 5.0.0 •

Changelog

Source

5.0.0

This is a compatibility release for Angular 8 and TypeScript 3.4.

Breaking Changes
  • update peer dependencies to require Angular >=8.0.0
  • update peer dependencies to require TypeScript >=3.4.0
Features
  • refactor FormState and Unboxed conditional type definitions to be simpler, which can improve build times and IDE performance (e9f504b), (24b25db)
Build Improvements
  • switch to ng-packagr for building the library (2d126c5)
  • add dtslint tests to ensure stability of FormState and Unboxed types (255c648)
Bugfixes
  • allow enabling empty disabled array states (8a33d12), thanks @nihique for reporting this bug, closes #149

<a name="5.0.0-beta.2"></a>

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc