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

focus-graph

v3.2.5

Published

Form, data behaviours

Downloads

17

Readme

Focus Redux

Why ?

  • In focus components we provide a form which even if it was separated in sevral mixin, was really to use as a stand alone component.
  • We also found that there was state related issue inside many components, some from focus, some from the one built inside the projects.
  • We also want users to be able to have a better understanding of whats is going on, which actions are triggered, how is the state build.
  • We want you to have better devtools to use focus, to have a great Developer Experience.

What is under the hood

  • As in each focus extension, we use a tiny library to manage the application state called redux.
  • Previously we use to have a dispatcher from flux library and build state over EventEmitter
  • Now your state is build with functions and can be build with as many nodes as you need in structure like complex json object.

You need to read the awesome Redux documentation. At least the concepts.

Previous concepts

A component Component = f(state, props)

Concepts

What we rely on

We try to use two concepts

  • Providers :A Provider component will provide (as its name says it) informations to all its children via something called the context. (We do not encourage you to write any informations in the context by your own). Use the Providers instead.
  • Connectors: When we use a provider inside a component hierarchy, we try to use a connector to access its information.

Example

If I have an application

import React from 'react';
import {Provider as DomainProvider} from 'focus-redux/behaviours/domain';
import myDomains from './my-app-domains';
const MyApp = props => {
  return <DomainProvider domains={myDomains}>
    <Layout>
          <MyChildComponentWhoNeedsInformationsFromTheDomain name='great tutorial'/>
    </Layout>
  </DomainProvider>
};

Where

const MyChildComponentWhoNeedsInformationsFromTheDomain = props => {
  return <div>Hello props.domain.TEXT.formatter(props.name)</div>
}
export default connectToDomains(MyChildComponentWhoNeedsInformationsFromTheDomain);

Explainations

Provider(informationsToPassToTheComponentsTree) => Tree => connectToInformations(Child) => The child gets this information in its props.

// todo:

  • [] Check the Provider chain presence (form needs metadata)