You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// e.g. actions object in browser storageactions={greenItems: null,yellowItems: [{id: "1",body: "need to fix"},{id: "2",body: "could've improved"},
...
],redItems: [{id: "3",body: "failed to fix"},{id: "4",body: "failure in life"},
...
]}
Reducer to support these actions:
ADD_YELLOW_ITEM (add one to yellowItems)
ADD_RED_ITEM (add one to redItems)
REMOVE_YELLOW_ITEM (remove one from yellowItems by id)
REMOVE_RED_ITEM (remove one from redItems by id)
SET_YELLOW_ITEMS (replace yellowItems array)
SET_RED_ITEMS (replace redItems array)
INIT (set whole actions object)
How it will generally work:
Initialized with all Yellow and Red items in PreviousList
Has access to currentMonday
Similar to PreviousList, gets all Yellow / Red items from previous week to firstMonday and dispatches INIT
User clicks Move to Green/Yellow/Red
REMOVE_YELLOW_ITEM / REMOVE_RED_ITEM from Actions context
ADD_YELLOW_ITEM / ADD_RED_ITEM to Current's List context
User clicks Delete
REMOVE_YELLOW_ITEM / REMOVE_RED_ITEM from Actions context
Update: Decided to reuse ListContext to create a pseudo Actions context, but with a null greenItems field and without accessing / modifying this field.
The text was updated successfully, but these errors were encountered:
Schema:
Reducer to support these actions:
yellowItems
)redItems
)yellowItems
byid
)redItems
byid
)yellowItems
array)redItems
array)actions
object)How it will generally work:
currentMonday
firstMonday
and dispatchesINIT
Move to Green/Yellow/Red
REMOVE_YELLOW_ITEM
/REMOVE_RED_ITEM
from Actions contextADD_YELLOW_ITEM
/ADD_RED_ITEM
to Current's List contextDelete
REMOVE_YELLOW_ITEM
/REMOVE_RED_ITEM
from Actions contextUpdate: Decided to reuse
ListContext
to create a pseudo Actions context, but with a nullgreenItems
field and without accessing / modifying this field.The text was updated successfully, but these errors were encountered: