npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

immutable-core-component

v0.1.0

Published

Dynamic UI components for Immutable App

Downloads

62

Readme

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.

| name | type | description | |-------------------|-----------|----------------------------------------------| | binds | object | map of ids and data properties to bind | | minify | boolean | minify js sent to client | | placeholders | object | map of data properties and placeholder values| | refreshInterval | integer | time in ms between refresh of client data | |-------------------|-----------|----------------------------------------------| | preBind | function | hook that executes before bind | | preGet | function | hook that executes before get | | preRefresh | function | hook that executes before refresh | | preRender | function | hook that executes before render | | preSet | function | hook that executes before set | | postBind | function | hook that executes after bind | | postGet | function | hook that executes after get | | postRefresh | function | hook that executes after refresh | | postRender | function | hook that executes after render | | postSet | function | hook 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

| name | type | description | |-----------|-----------|------------------------------------------------------| | css | string | css to include on page - will be wrapped in | | helpers | object | map of handlebars helper names and functions | | js | string | js to include - will be wrapped in anonymous function| | partials | object | map of handlebars partials names and template strings| | template | string | main handlebars template string |