© The Author(s), under exclusive license to APress Media, LLC , part of Springer Nature 2021
D. TangPro Ember Datahttps://doi.org/10.1007/978-1-4842-6561-1_6

6. Swapping the API with Local Storage

David Tang1  
(1)
Playa Vista, CA, USA
 

We now know how to write an adapter and serializer from scratch as we learned in the last chapter. Imagine we’ve been tasked with swapping our backend to Local Storage. We know that adapters are responsible for figuring out how to talk to a backend via a RESTful API. They figure out how to retrieve data and where to send data for storage. In this chapter, we will swap out our custom RESTAdapter with our own Local Storage adapter, and our application should continue to work seamlessly.

Creating an Empty Adapter

To start, ...

Get Pro Ember Data: Getting Ember Data to Work with Your API now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.