-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(schematics): remove creators option (#3311)
BREAKING CHANGES: BEFORE: Creating actions, reducers, and effects is possible without using the creator syntax is possible. AFTER: - All schematics use the non-creator syntax to scaffold the code. - The option `--creators` (and `-c`) is removed from the schematic options. - The `skipTests` option is removed while generating actions.
- Loading branch information
1 parent
9764634
commit e86278a
Showing
50 changed files
with
460 additions
and
979 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 0 additions & 7 deletions
7
...tion/creator-files/__name@dasherize@if-flat__/__name@dasherize__.actions.spec.ts.template
This file was deleted.
Oops, something went wrong.
15 changes: 0 additions & 15 deletions
15
...rc/action/creator-files/__name@dasherize@if-flat__/__name@dasherize__.actions.ts.template
This file was deleted.
Oops, something went wrong.
7 changes: 0 additions & 7 deletions
7
...s/src/action/files/__name@dasherize@if-flat__/__name@dasherize__.actions.spec.ts.template
This file was deleted.
Oops, something went wrong.
33 changes: 12 additions & 21 deletions
33
...matics/src/action/files/__name@dasherize@if-flat__/__name@dasherize__.actions.ts.template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,15 @@ | ||
import { Action } from '@ngrx/store'; | ||
import { createAction, props } from '@ngrx/store'; | ||
|
||
export enum <%= classify(name) %>ActionTypes { | ||
<%= prefix %><%= classify(name) %>s = '[<%= classify(name) %>] <%= prefix %> <%= classify(name) %>s', | ||
<% if (api) { %><%= prefix %><%= classify(name) %>sSuccess = '[<%= classify(name) %>] <%= prefix %> <%= classify(name) %>s Success',<% } %> | ||
<% if (api) { %><%= prefix %><%= classify(name) %>sFailure = '[<%= classify(name) %>] <%= prefix %> <%= classify(name) %>s Failure',<% } %> | ||
} | ||
export const <%= prefix %><%= classify(name) %>s = createAction( | ||
'[<%= classify(name) %>] <%= classify(prefix) %> <%= classify(name) %>s' | ||
); | ||
|
||
export class <%= prefix %><%= classify(name) %>s implements Action { | ||
readonly type = <%= classify(name) %>ActionTypes.<%= prefix %><%= classify(name) %>s; | ||
} | ||
<% if (api) { %> | ||
export class <%= prefix %><%= classify(name) %>sSuccess implements Action { | ||
readonly type = <%= classify(name) %>ActionTypes.<%= prefix %><%= classify(name) %>sSuccess; | ||
constructor(public payload: { data: any }) { } | ||
} | ||
<% if (api) { %>export const <%= prefix %><%= classify(name) %>sSuccess = createAction( | ||
'[<%= classify(name) %>] <%= classify(prefix) %> <%= classify(name) %>s Success', | ||
props<{ data: any }>() | ||
);<% } %> | ||
|
||
export class <%= prefix %><%= classify(name) %>sFailure implements Action { | ||
readonly type = <%= classify(name) %>ActionTypes.<%= prefix %><%= classify(name) %>sFailure; | ||
constructor(public payload: { error: any }) { } | ||
} | ||
<% } %> | ||
<% if (api) { %>export type <%= classify(name) %>Actions = <%= prefix %><%= classify(name) %>s | <%= prefix %><%= classify(name) %>sSuccess | <%= prefix %><%= classify(name) %>sFailure;<% } %> | ||
<% if (!api) { %>export type <%= classify(name) %>Actions = <%= prefix %><%= classify(name) %>s;<% } %> | ||
<% if (api) { %>export const <%= prefix %><%= classify(name) %>sFailure = createAction( | ||
'[<%= classify(name) %>] <%= classify(prefix) %> <%= classify(name) %>s Failure', | ||
props<{ error: any }>() | ||
);<% } %> |
Oops, something went wrong.