Skip to content

Instantly share code, notes, and snippets.

@aaronschachter
Last active February 17, 2016 19:52
Show Gist options
  • Save aaronschachter/c6b612ce1a3ae815aec5 to your computer and use it in GitHub Desktop.
Save aaronschachter/c6b612ce1a3ae815aec5 to your computer and use it in GitHub Desktop.
LDT in React

currentUser (obj)

  • First Name (string)
  • AvatarURL (string)
  • Location (string)
  • Signups (array)
    • Campaign ID (int)
    • isCurrent (bool)
    • Signup ID (int)
    • Reportback (obj)
      • ImageURL (string)
      • Caption (string)
      • Quantity (int)

--

Self Profile

All data listed above can change.

Doing: Filter signups where current = TRUE, campaign = active, and a reportback doesn't exist

Completed: Show all signups with reportbacks

Events:

  • currentUser changes (user logs in, logs out and logs in as someone else)
  • user uploads new avatar
  • activity (user signs up or reports back from CampaignView)

Active Campaign:

Only need to know if a Signup exists where camapign_run.current. Item that can change:

  • Current Signup (null | signed up | reportback)
@aaronschachter
Copy link
Author

One idea is that we also keep a list of Campaign dictionaries, each of which has a CurrentUserSignup... although this doesn't really help us much for the Self Profile, unless we loop through all Campaigns to determine the User's profile. What's not so nice there basically the signups endpoint gives us the Signups to use as our dataSource, which works great when viewing a non-self profile.

Plus ideally we move away from storing all Campaigns in memory? (or at least store into CoreData)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment