No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

addEntityToEntityMap.js.flow 678 B

hace 3 años
1234567891011121314151617181920212223
  1. /**
  2. * Copyright (c) Facebook, Inc. and its affiliates.
  3. *
  4. * This source code is licensed under the MIT license found in the
  5. * LICENSE file in the root directory of this source tree.
  6. *
  7. * @format
  8. * @flow
  9. * @emails oncall+draft_js
  10. */
  11. 'use strict';
  12. import type DraftEntityInstance from "./DraftEntityInstance";
  13. import type { OrderedMap } from "immutable"; // TODO: when removing the deprecated API update this to use the EntityMap type
  14. // instead of OrderedMap
  15. let key = 0;
  16. function addEntityToEntityMap(entityMap: OrderedMap<*, *>, instance: DraftEntityInstance): OrderedMap<*, *> {
  17. return entityMap.set(`${++key}`, instance);
  18. }
  19. module.exports = addEntityToEntityMap;