Exemplo n.º 1
0
 private static ImmutableList <Guid> ReduceContacts(ImmutableList <Guid> previousState, object action)
 {
     if (action is ActionOnUser.AddContact a)
     {
         return(previousState.AddOrCreate(a.newContact.id));
     }
     return(previousState);
 }
Exemplo n.º 2
0
 private static ImmutableList <MyCircle> CirclesReducer(MyModel parent, ImmutableList <MyCircle> circles, object action)
 {
     circles = circles.MutateEntries(action, CircleReducer);
     if (action is AddCircleAction a)
     {
         circles = circles.AddOrCreate(a.newCircle);
     }
     return(circles);
 }