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

immutable-core-component

Package Overview
Dependencies
Maintainers
1
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

immutable-core-component

Dynamic UI components for Immutable App

  • 0.0.35
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

immutable-core-component

Immutable Core Component provides the server side functionality for Immutable App Component. Together they provide a framework for dynamic UI components that integrate with the Immutable App ecosystem.

When using Immutable App, Immutable Core Components will be instantiated automatically from the files in the component directory. The examples here use Immutable Core Component directly. See the Immutable App Component documentation for usage examples with an app.

Server configuration options

var component = new ImmutableCoreComponent({
    name: 'foo',
    server: {
        get: function (args) {}
        new: function (args) {},
        set: function (args) {},
    },
})

This example will create a new Immutable Core module named fooComponent with get, new and set methods.

The arguments for server will be taken from the foo.server.js file when used with Immutable App Component.

Client configuration options

var component = new ImmutableCoreComponent({
    client: {
        binds: { 'element-id', 'data.property' },
        minify: true,
        placeholders: { foo: 'foo', 'foo.bar', 'bar' },
        preRender: function (args) { .... }
    }
})

The arguments for client will be taken from the foo.client.js file when used with Immutable App Component.

nametypedescription
bindsobjectmap of ids and data properties to bind
minifybooleanminify js sent to client
placeholdersobjectmap of data properties and placeholder values
refreshIntervalintegertime in ms between refresh of client data
----------------------------------------------------------------------------
preBindfunctionhook that executes before bind
preGetfunctionhook that executes before get
preRefreshfunctionhook that executes before refresh
preRenderfunctionhook that executes before render
preSetfunctionhook that executes before set
postBindfunctionhook that executes after bind
postGetfunctionhook that executes after get
postRefreshfunctionhook that executes after refresh
postRenderfunctionhook that executes after render
postSetfunctionhook that executes after set

General configuration options

var component = new ImmutableCoreComponent({
    css: '.foo { display: block }',
    helpers: { bar: function () {...} },
    js: 'console.log("foo")',
    partials: { bam: 'Goodbye {{foo}}' },
    template: 'Hello {{foo}}',
})

When using Immutable App Component:

  • the css property comes from foo.css
  • the helpers object is populated from the helpers directory
  • the js property comes from foo.js
  • the partials object is populated from the partials directory
  • the template property comes from foo.hbs
nametypedescription
cssstringcss to include on page - will be wrapped in
helpersobjectmap of handlebars helper names and functions
jsstringjs to include - will be wrapped in anonymous function
partialsobjectmap of hadlebars partials names and template strings
templatestringmain handlebars template string

FAQs

Package last updated on 02 Dec 2017

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