O'Reilly logo

React Native By Example by Richard Kho

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Utilities

The utils folder stores helper methods that we will be using in our application. The dateMethods deals with the different methods that we will use to get different parts of the date, while storageMethods handles access to AsyncStorage.

Our first bullet point from app planning says that upon launching the app, if a budget for this month has not yet been set, it should ask the user to input their monthly goal and save it into AsyncStorage.

Based on the preceding intent, we want to do the following things:

  • Grab the current month and year
  • Retrieve the object storing our expenses in AsyncStorage and check the month and year to check whether a budget has been set
  • If it hasn't, then prompt the user to enter a budget for the month and ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required