Skip to content
This repository has been archived by the owner on Jan 13, 2023. It is now read-only.

Commit

Permalink
Add postProcess hint to model generator (#113)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinvangelder authored Oct 30, 2018
1 parent 4a984c9 commit f9ee56a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions templates/model.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ export const <%= props.pascalName %>Model = types
.views(self => ({}))
.actions(self => ({}))

/**
* Un-comment the following to omit model attributes from your snapshots (and from async storage).
* Useful for sensitive data like passwords, or transitive state like whether a modal is open.

* Note that you'll need to import `omit` from ramda, which is already included in the project!
* .actions(self => ({
* postProcessSnapshot: omit(["password", "socialSecurityNumber", "creditCardNumber"]),
* }))
*/

type <%= props.pascalName %>Type = typeof <%= props.pascalName %>Model.Type
export interface <%= props.pascalName %> extends <%= props.pascalName %>Type {}
type <%= props.pascalName %>SnapshotType = typeof <%= props.pascalName %>Model.SnapshotType
Expand Down

0 comments on commit f9ee56a

Please sign in to comment.