If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Problem
For pattern B we have decided to return errors from PHP in an object keyed by microtime as an integer. If we want to set errors in the failureData on the JS side, we need to be able to get microsecond timestamps.
Solution
We will create a util function to get microseconds, but with millisecond precision. We will add a function DateUtils.getMicroseconds() which will return Date.now() * 1000.
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Problem
For pattern B we have decided to return errors from PHP in an object keyed by microtime as an integer. If we want to set errors in the failureData on the JS side, we need to be able to get microsecond timestamps.
Solution
We will create a util function to get microseconds, but with millisecond precision. We will add a function
DateUtils.getMicroseconds()which willreturn Date.now() * 1000.