Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

experimental-nuclear-js

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

experimental-nuclear-js

Experimenting with new APIs for Nuclear

  • 0.0.1
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

This repo contains experimental APIs for building isomorphic applications with Nuclear.js. Current methods include:

  • serialize and deserialize: call each store's (de)serialize method, falling back to toJS/toImmutable when no custom method is implemented

  • createActions: take a list of action names and returns a map of action names to Reflux-style functors

Also extends the Nuclear constructor to support declarative module definitions:

var reactor = new Reactor(
  {
    "moduleA":  {
                  "simpleActions":  [
                                      "doStuff",
                                      "doDifferentStuff",
                                    ],

                  "complexActions": {
                                      "doComplexStuff": function (payload) {
                                                          this.actions.doStuff(payload);

                                                          doSomethingAsync(payload).then(
                                                            this.actions.doDifferentStuff
                                                          );

                                                          return payload;
                                                        },
                                    ],

                  "stores":         {
                                      "stuff":  {
                                                  "serialize":    function (lastValue) {
                                                                    return lastValue.toJSON();
                                                                  },

                                                  "deserialize":  function (serializedValue) {
                                                                    return new Stuff(serializedValue);
                                                                  },

                                                  "initialize":   function () {
                                                                    this.on(
                                                                      this.actions.doStuff,                                                  
                                                                      function (lastValue, newValue) {
                                                                        return lastValue.append(newValue.stuff);
                                                                      }
                                                                    );
                                                                  },
                                                },
                                    },
                
                  "getters"         {
                                      "stuff":  ["stuff"],
                                    },
                },
  }
);

reactor.moduleA.actions.doStuff(
  {
    "stuff":  [
                "banana", 
                "peaches"
              ],
  }
);

As this evolves, some methods (like serialize/deserialize) will migrate upstream to Nuclear. The rest will form a new library that builds upon Nuclear with conventions that make isomorphic applications easier to create.

FAQs

Package last updated on 03 Jun 2015

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc