DataSource

The DataSource class is the base class for a remote provider of data used by the Arva models.

Usually, you will not come across DataSources outside of your App class constructor (which sets up the default DataSource to use in your application) unless you dive deeper into the Arva framework.

Available DataSources

We currently have DataSources for both Firebase and SharePoint, which work out of the box.

Custom DataSource

If you want to write a DataSource for another provider, you'll have to do the following:

  • Create a new DataSource class that extends the DataSource.
  • Implement all methods defined in the DataSource.
  • Create a new Snapshot class that extends Snapshot.
  • The new Snapshot class should implement all methods that Snapshot does.

When we developed the DataSource base class, we were influenced by the design choices of Google's Firebase. Should it be unclear what the behaviour of a DataSource method should be, either shoot us a message on Gitter or have a look at Firebase's docs.

Don't forget to send a pull request so the community can enjoy your awesome new provider!