
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
fluorine-orchestra
Advanced tools
Smart Collections with Dependency Resolution using Immutable.js for Fluorine.
Keeping a local copy of your database collections can be troublesome. Rewriting code to handle CRUD operations, normalize incoming data and resolve dependencies is not something to do every day.
Orchestra implements a data orchestration layer for Fluorine to easily solve your collection worries.
This is just a short example that quickly presents most features of Orchestra. It is of course not representetive for how to use it in real React projects.
import { createDispatcher } from 'fluorine-lib'
import { createOrchestra, createStore } from 'fluorine-orchestra'
const dispatcher = createDispatcher()
// Create stores for your collections
const PostStore = createStore('posts')
const UserStore = createStore('users')
.pre(user => { // Modify items before they're stored
const firstName = user.get('firstName');
const lastName = user.get('lastName');
return user.set('name', firstName + ' ' + lastName);
})
.dependsOn( // Define dependencies between collections
'posts',
user => user.get('postIds', new List()), // Specify how to get the postId(s)
(user, posts) => user.set('posts', posts) // Specify how to set posts on users
)
.post(user => { // Modify the dependency-resolved items before they reach your views
const postSize = user.get('posts').size;
return user.set('postSize', postSize);
});
// Assemble the orchestra of stores
const orchestra = createOrchestra(PostStore, UserStore);
const {
posts, // It spits out Fluorine stores (Observables) emitting your resolved state
users
} = orchestra.reduce(dispatcher);
// Inserting items?
dispatcher.next(UserStore.insert({
id: 'abc-1',
firstName: 'John',
lastName: 'Meyer'
}));
// Get Creative: Fetch missing ids that Orchestra can't find in its collections
const subscription = PostStore
.observeMissing()
.map(ids => fetchPosts(ids))
.subscribe(dispatcher.next);
You can easily create stores for your different collections and define how to transform them when they're being fed from the server into your stores. Also define which dependencies they have and how to resolve them. The Orchestra will combine all stores and resolve the dependencies.
The result are normal Fluorine stores (Observables). You can pass these on, as you'd like.
If some items are missing, their ids will be reported on the respective stores. You can use this to fetch missing data on demand.
Method to create actions to insert, remove, filter or update items on the store are already present and can immediately be used.
It is a perfect fit for your project if:
FAQs
A data orchestration layer for Fluorine
The npm package fluorine-orchestra receives a total of 0 weekly downloads. As such, fluorine-orchestra popularity was classified as not popular.
We found that fluorine-orchestra 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.