Skip to content

Latest commit

 

History

History
41 lines (30 loc) · 1.05 KB

README.md

File metadata and controls

41 lines (30 loc) · 1.05 KB

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