Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
firestruct
Advanced tools
npm install firestruct
import Firestruct from "firestruct";
const count = c => c.value();
const increment = c => c.update(i => i + 1);
const fs = new Firestruct("https://test.firebaseio.com/clickcount");
fs.on("swap", (newCursor, oldCursor, path) => {
const clicksCursor = newCursor.cursor("clicks");
React.render(
<ClickCount
count={ count(clicksCursor) }
onClick={ event => increment(clicksCursor) } />,
document.body
);
);
on(eventName, callback)
Event handler. Provides callback with 3 arguments:
Events:
"swap"
: data changestructure._fb
Deprecated. Reference to raw Firebase object.
Please make note of any use; it should be unnecessary for all but Auth.
Cursors are immutable references to the current structure.
cursor.cursor(path)
Returns a new cursor.
path
is an array/string pointing to a child location.
cursor.value()
Returns the value of the current cursor
cursor.update(callback)
Replaces the value of the current cursor with the return value of callback
. TODO: Returns the new cursor.
callback
is provided with the current value of the cursor as the first argument.
New branches may be created by selecting a non-existant path, then calling update
with some data.
Old branches may be deleted by selecting a path, then setting it as undefined
.
cursor.cursors()
Convenience function. Returns an array of child [key, cursor]
pairs.
cursor._fb
Deprecated. Reference to raw Firebase snapshot.
Please make note of any use; it should be unnecessary. Tree-climbing and current node keys will never be supported.
FAQs
Minimal immutable Firebase API
The npm package firestruct receives a total of 0 weekly downloads. As such, firestruct popularity was classified as not popular.
We found that firestruct 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.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.