make ReactMarker initialization one-shot

Reviewed By: AaaChiuuu

Differential Revision: D4996560

fbshipit-source-id: 020a850f72a2b5c2327b904cac3245d39e114508
This commit is contained in:
Ben Nham 2017-05-03 14:55:46 -07:00 committed by Facebook Github Bot
parent b2f3a65eab
commit cc3d034460
1 changed files with 4 additions and 5 deletions

View File

@ -19,12 +19,11 @@ public class ReactMarker {
private static @Nullable MarkerListener sMarkerListener = null;
public static void setMarkerListener(MarkerListener listener) {
SoftAssertions.assertCondition(
sMarkerListener == null,
"MarkerListener is being overwritten.");
public static void initialize(MarkerListener listener) {
if (sMarkerListener == null) {
sMarkerListener = listener;
}
}
@DoNotStrip
public static void clearMarkerListener() {