GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing nullstack.app — Context - Nullstack ContextEvery function in Nullstack receives a context as the argument. There are two contexts, one for the client and another one for the server. The client context lives as long as the browser tab is open. The server context lives as long as the server is running. Both contexts are proxies that merge the keys of 3 objects: 1 - Nullstack ContextThese are the information that the framework makes available to you by default. The available global keys in both server and client are:The keys available only in server functions are:The key available only in client:2 - Application ContextWhen you set a key to the context it will be available for destructuring at any depth of the application, even the parents of your component or 3rd party applications that mount your component. Updating a key in the context causes the application to re-render automatically. You can think of this as a single concept to replace stores, contexts, services, and reducers at the same time using the dependency injection pattern with vanilla JavaScript objects instead.
3 - Component ContextThis one contains the attributes you declare in your tag, and including: If the attribute is declared in a component tag every function of that component will have access to that attribute in its context. If the attribute is declared in a tag that has an event it will be merged into the event function context.
Functions ContextEvery function of subclasses of Nullstack is injected with a copy of the instance context merged with its arguments. Arguments are optional, but if declared, must be a single object with keys of your choice.
Next Step➡️ Learn more about Core Features: Two-way bindings❓ Have any questions or suggestions? Join our Discord |
| You are visitor 01402775 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |