Skip to content

Operator to support AJAX persistence and multicasting #2013

@benlesh

Description

@benlesh

Currently, there's a PR to remove cache #2012. The original intention of cache was to support use-cases, mostly coming from the Angular 2 community, revolving around wanting to persist successful AJAX requests, but still enable retry and retryWhen on failed AJAX requests.

This operator should

  1. Multicast the source observable
  2. Keep all values and "replay" them after a successful completion
  3. Enable "retrying" on error

Stuff to consider, and unanswered questions:

  1. What are the behaviors when applied to a never-ending observable (Observable.interval(100), for example)
  2. How will this operator behave when applied to another hot observable?

Possible Solutions

  • Re-add the cache operator but rename it to something more descriptive of it's purpose.
  • Add a simplified operator that takes no arguments called shareResults proposed here

For sake of discussion, we'll call this operator persist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions