Dmitry Shnyrev
Dmitry Shnyrev

Reputation: 76

Is there a way to create and use store with @ngrx/store away from angular app?

I need to share the same (one global store) between two angular apps in site page. Is there any way to create @ngrx/store manually before apps bootstrap and next pass it as parameter to each angular2 app?

Upvotes: 0

Views: 1273

Answers (1)

John Siu
John Siu

Reputation: 5092

Web Storage / Local Storage

Maybe you can explore Web Storage : https://www.w3schools.com/html/html5_webstorage.asp

Quote from the page:

Local storage is per origin (per domain and protocol). All pages, from one origin, can store and access the same data.

There are numerous example in the web, here is one: http://www.unitydatasystems.com/blog/2015/12/09/angular-2-caching-webservice-results-in-local-storage/

@ngrx/store + localstorage

This package : https://github.com/btroncone/ngrx-store-localstorage

Quote:

Simple syncing between ngrx store and local storage.

Upvotes: 3

Related Questions