intercellular / cell

A self-driving web app framework

Home Page:https://www.celljs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Noob question... $global; variable

moses5407 opened this issue · comments

Is this available in the browser:

  • at all?
  • via cell?

Thanks!

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

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.

@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!

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

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

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