jamesplease / jamesplease/orbit-examples

Example configuration: memory + rest source

Open
#3 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1
Forks
0
PR merge metrics
No merged PRs in 30d

Description

I think a common use case for Orbit will be using the memory source in conjunction with the rest source. A rest source, for newcomers to Orbit, is typically an API that returns data.

The behavior is as follows:
1. Requests are **always** made against the memory source
2. The memory source defers to the rest source when a value is not found
3. Values returned by the rest source are cached in the memory source
4. Subsequent requests for the same resource will use the cached value
#

This example should also explore cache invalidation. Two common invalidation strategies I've seen are:
1. automatic invalidation based on time (resources are re-requested after, say, 5 minutes have passed)
2. order invalidation at the time of the request. In pseudocode: `store.find('author', null, {cache: false});`

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the memory source, rest source, and store.find entry points in the examples repository. Build an example that demonstrates the four stated caching behaviors and explores time-based and request-time invalidation. Done means the example clearly shows fallback, caching, repeated reads, and both invalidation strategies.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.