genDuckNgRx 0.0.1-alpha

This is a prerelease version of genDuckNgRx.
dotnet tool install --global genDuckNgRx --version 0.0.1-alpha                
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local genDuckNgRx --version 0.0.1-alpha                
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=genDuckNgRx&version=0.0.1-alpha&prerelease                
nuke :add-package genDuckNgRx --version 0.0.1-alpha                
  1. Write, one or more, State in Json File;like this:
{
  "token": "any",
  "expired": "Date"
}
  1. On Folder of Json File run gdk gen-states, to create files with interfaces .ts; like this:
export interface Acesso {
  token: any;
  expired: Date;
}
  1. Run command gdk gen-duck <Json FileName> too generate code duck like this:
import {
  createAction,
  props,
  createReducer,
  on,
  createFeatureSelector
} from '@ngrx/store';
import { Acesso as State } from './Acesso.model';

// actions
export const setToken = createAction(
  '[ACESSO] SET_TOKEN',
  props<{ token: any }>()
);

export const setExpired = createAction(
  '[ACESSO] SET_EXPIRED',
  props<{ expired: Date }>()
);

// initial state
export const initialState: State = {
  token: null,
  expired: new Date()
};
export const selectAcesso = createFeatureSelector<State>('acesso');
// reducer
export const acessoReducer = createReducer(
  initialState,
  on(setToken, (state, { token }): State => ({ ...state, token })),
  on(setExpired, (state, { expired }): State => ({ ...state, expired }))
);

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
0.0.1-alpha 158 4/7/2022