Comments (7)
Do you call .dump()
in browser environment? I'm just trying to find the most sensible solution. The .dump()
is for server side rendering and we may actually could just do:
dump(): string {
if (this.isDomAvailable) return ''
const data = this.memory.join('\n')
return data
}
from metapatcher.
Current workaround is using memory directly: metapatcher.memory.join('\n')
.
from metapatcher.
There should certainly be a check for dom while calling dump. Thank you for the PR @indifferentghost I will merge it shortly.
from metapatcher.
@indifferentghost I understand you use .dump()
server-side as it should be but what problem do you have with its clearing cache? Server renders happen once per request and so it just dumps once and clears itself. Can you elaborate the problem here?
The way i use it is simply:
import.meta.env.SSR ? metapatcher.dump() : ''
from metapatcher.
Hey, I'm using it as middleware for keeping head state across endpoints, many of these use the same head, but a few of them are different. It's useful for me to keep state rather than a finished dump.
from metapatcher.
I don't see why it shouldn't though. I don't, nor do I foresee using it in the browser.
from metapatcher.
It's just because it's meant to be used in server side, i mean the dump method. we are able to use html dom like a memory in browsers so i would like to keep it as much as possible. anyway, i released the new version, it should be fixed now. thank you for the collaboration @indifferentghost
from metapatcher.
Related Issues (3)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metapatcher.