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,11 +19,10 @@ public class ReactMarker {
private static @Nullable MarkerListener sMarkerListener = null;
public static void setMarkerListener(MarkerListener listener) {
SoftAssertions.assertCondition(
sMarkerListener == null,
"MarkerListener is being overwritten.");
sMarkerListener = listener;
public static void initialize(MarkerListener listener) {
if (sMarkerListener == null) {
sMarkerListener = listener;
}
}
@DoNotStrip