// NewConsoleOutputProjection consutructs an example projection that outputs
// new accounts to the console. It might as well be to any kind of
// database, disk, memory etc...
NewConsoleOutputProjection consutructs an example projection that outputs
new accounts to the console. It might as well be to any kind of
database, disk, memory etc
// NewConsoleOutputProjection consutructs an example projection that outputs // new accounts to the console . It might as well be to any kind of // database disk memory etc ...
func NewConsoleOutputProjection() eventstore.Projection {
	return func(data eventstore.EventData) error {
		switch data.Event.(type) {
		case account.NewAccountOpenned:
			evt := data.Event.(account.NewAccountOpenned)
			fmt.Printf("Account: #%s | Holder: <%s>\n", evt.ID, evt.Holder)
		default:
			fmt.Println("not interested in this event")
		}
		return nil
	}
}
func NewConsoleOutputProjection ( ) eventstore . Projection { return func ( data eventstore . EventData ) error { switch data . Event . ( type ) { case account . NewAccountOpenned : evt := data . Event . ( account . NewAccountOpenned ) fmt . Printf ( " \n " , evt . ID , evt . Holder ) default : fmt . Println ( " " ) } return nil } }
NewConsoleOutputProjection consutructs an example projection that outputs
new accounts to the console.
NewConsoleOutputProjection consutructs an example projection that outputs new accounts to the console .