Source: external/task-instance/initial-state.js

  1. import { COMPLETION_PENDING } from './completion-states';
  2. export const INITIAL_STATE = {
  3. completionState: COMPLETION_PENDING,
  4. /**
  5. * If this TaskInstance runs to completion by returning a property
  6. * other than a rejecting promise, this property will be set
  7. * with that value.
  8. *
  9. * @memberof TaskInstance
  10. * @instance
  11. * @readOnly
  12. */
  13. value: null,
  14. /**
  15. * If this TaskInstance is canceled or throws an error (or yields
  16. * a promise that rejects), this property will be set with that error.
  17. * Otherwise, it is null.
  18. *
  19. * @memberof TaskInstance
  20. * @instance
  21. * @readOnly
  22. */
  23. error: null,
  24. /**
  25. * True if the task instance is fulfilled.
  26. *
  27. * @memberof TaskInstance
  28. * @instance
  29. * @readOnly
  30. */
  31. isSuccessful: false,
  32. /**
  33. * True if the task instance resolves to a rejection.
  34. *
  35. * @memberof TaskInstance
  36. * @instance
  37. * @readOnly
  38. */
  39. isError: false,
  40. /**
  41. * True if the task instance is canceled
  42. *
  43. * @memberof TaskInstance
  44. * @instance
  45. * @readOnly
  46. */
  47. isCanceled: false,
  48. /**
  49. * True if the task instance has started, else false.
  50. *
  51. * @memberof TaskInstance
  52. * @instance
  53. * @readOnly
  54. */
  55. hasStarted: false,
  56. /**
  57. * True if the task has run to completion.
  58. *
  59. * @memberof TaskInstance
  60. * @instance
  61. * @readOnly
  62. */
  63. isFinished: false,
  64. };