intercellular / cell

A self-driving web app framework
https://www.celljs.org
MIT License
1.51k stars 94 forks source link

Noob question... $global; variable #150

Open moses5407 opened 7 years ago

moses5407 commented 7 years ago

Is this available in the browser:

Thanks!

gliechtenstein commented 7 years ago

@moses5407 I didn't understand what you mean by global variable, could you share an example of what you're trying to do?

moses5407 commented 7 years ago

I was just wondering of the $global.set is available in the browser via cell in the same way it can be used in jasonette to persist data between sessions. I haven't been able to find a clear answer on availability of global variables in browsers.

gliechtenstein commented 7 years ago

@moses5407 haha no, cell is completely separate from Jasonette (although you will see some close integrations between the two in the future). the $global and all those JSON syntax is specific to Jasonette. Cell is a general purpose Javascript library for building web apps. Feel free to ask me further on slack if you need more clarification!

moses5407 commented 7 years ago

Yep..I knew the difference .. but not how that related using a global for persistence. Thanks!

moses5407 commented 7 years ago

Now, why didn't I just ask if there's a local storage solution available for offline situations in cell? Haha... doing so now.

gliechtenstein commented 7 years ago

Cell is really just the 3 rules https://github.com/intercellular/cell#there-are-only-3-rules and nothing more.

It's all about how to structure an app, and the whole point of the library is that you don't need some additional API, you use web browser's native API. So it doesn't need any "localstorage solution". You just use window.localStorage

moses5407 commented 7 years ago

Heh..I'm sure that is basic info to you but my knowledge of localStorage is pretty bad..so thanks for taking the time to answer, especially with such a helpful link!

Cheers!

On Sun, Jul 23, 2017 10:54 AM, gliechtenstein notifications@github.com wrote: Cell is really just the 3 rules https://github.com/intercellular/cell#there-are-only-3-rules and nothing more.

It's all about how to structure an app, and the whole point of the library is that you don't need some additional API, you use web browser's native API. So it doesn't need any "localstorage solution". You just use window.localStorage

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.