Socket
Socket
Sign inDemoInstall

fruxxi

Package Overview
Dependencies
8
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fruxxi

Franks Flux Implementation.


Version published
Weekly downloads
6
increased by100%
Maintainers
1
Install size
82.2 kB
Created
Weekly downloads
 

Changelog

Source

0.0.5 (2015-08-21)

<a name="0.0.4"></a>

Readme

Source

Fruxxi

(Fr)anks Fl(ux) (I)mplementation

Dispatcher

The dispatcher acts as an event forwarder. It takes every event called by the dispatch method and calls all registered callbacks with that data submitted via the dispatch.

One can register callback functions to the dispatcher. All callback functions, even from different sources, are called on each dispatch call.

The registered callbacks are called with the two arguments provided via the dispatch method call. The first one is unique name of the dispatch and the second is the data associated to that name of dispatch.

StoreCreator

The store creator is just a function returning a class.

The storeMessages parameter is a map of all the messages the store should respond to.

initialStoreData is used to fill the store with a initial dataset and is optional.

To create a new store pass storeMessages and optionally initialStoreData to the creator function. This call will return a class. The class must be called with the dispatcher as argument.

EXAMPLE:

file: store.js

import storeCreator from './storeCreator.js';

const initialStoreData = {
 status: 'OK',
 view: 'fair-at-link'
};

const storeMessages = new Map([
 ['messageType', (data, oldData) => updateStore(data, oldData)]
 ]);

export default storeCreator(storeMessages, initialStoreData);

file: main.js

import Dispatcher from './dispatcher.js';

import Store from './store.js';

let dispatcher = new Dispatcher();
let store =  new Store(dispatcher);

Component

The component class implements a kind of frontend component. This must not be a dom element but can also be a kind of logical component that holds states and triggers actions.

The constructor must be provided with a stores object. The actions are not mandatory. Some components might not need to trigger actions.

Each value in the stores object should be an event emitting class. The constructor iterates over the Object and adds a onChange method to that store.

Keywords

FAQs

Last updated on 21 Aug 2015

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc