![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
mithril-node-render
Advanced tools
Readme
Use mithril views to render server side
npm install mithril-node-render
// use a mock DOM so we can run mithril on the server
require('mithril/test-utils/browserMock')(global)
var m = require('mithril')
var render = require('mithril-node-render')
render(m('span', 'huhu')).then(function (html) {
// html === '<span>huhu</span>'
})
As you see the rendering is asynchron. It waits for resolve of all promises
that might get returned from oninit
callbacks.
var myAsyncComponent = {
oninit: function (node) {
return new Promise(function (resolve) {
node.state.foo = 'bar'
resolve()
})
},
view: function (node) {
return m('div', node.state.foo)
}
}
render(myAsyncComponent).then(function (html) {
// html === '<div>bar</div>'
})
Optionally pass in options as an object: m.render(component, options)
.
The following options are supported:
escapeAttributeValue(value)
Default: render.escapeHtml
A filter function for attribute values. Receives value, returns what is printed.
escapeString(value)
Default: render.escapeHtml
A filter function for string nodes. Receives value, returns what is printed.
strict
Default: false
Set this to true to close all empty tags automatically. Default is HTML mode where tags like <br>
and <meta>
are allowed without closing tags. This is required if you're rendering XML or XHTML documents.
FAQs
Node rending of mithril views
The npm package mithril-node-render receives a total of 97 weekly downloads. As such, mithril-node-render popularity was classified as not popular.
We found that mithril-node-render demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.