O'Reilly logo

SproutCore Web Application Development by Tyler Keating

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Introducing the data store

The SproutCore data store acts as the repository for most of the data that we will load into a SproutCore application. While you can have multiple data stores in your application, you will probably use just one for the sake of simplicity. To create a store, we simply create an instance of SC.Store and in fact, if you use the command line generator (that is, sproutcore gen app), you will find that a store is created for you by default, in the application's core.js file.

We typically create the main application store as a property of the application object. For example:

MyApp = SC.Application.create({
  
  // The main application data store, accessible as 'MyApp.store'
  store: SC.Store.create()
  
});

You can think of the store as ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required