Skip to content

High level API (client/server) for accessing Journey data.

License

Notifications You must be signed in to change notification settings

mozilla-magnet/journey-data

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Journey Storage Client

High level API for accessing stored data, either in the client, or from another source of data.

It's centered around issuing commands to get or initiate actions, a storage driver then interprets the commands into a result.

Quick Start

import { JourneyData } from 'journey-data';
import MockStorage from 'journey-data/src/storage/mock-storage';

const journeyData = new JourneyData(new MockStorage());

// get list of newest stories and like the latest one
const stories = journeyData.getNewestStories();
journeyData.likeStory(stories[0]);

Available API methods.

journeyData.getClosestPopularStories({ currentLocation, radius })
journeyData.getClosestStories({ currentLocation, radius })
journeyData.getNewestStories()
journeyData.likeStory({ id })
journeyData.deleteLikeStory({ id })
journeyData.visitStory({ id })
journeyData.deleteVisitStory({ id })
journeyData.getStory({ id });
journeyData.getUser({ id });
journeyData.logEvents([ { ...eventData }, ...events ]);

TODO: Use RealmStorage, migrations

License

MPL-2.0

About

High level API (client/server) for accessing Journey data.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published