Code Monkey home page Code Monkey logo

root's Introduction

effector-root

Commitizen friendly Conventional Commits code style: prettier

Do not depend on this package in your libraries!

Motivation

Sometimes we developed our apps and just afterwards start thinking about SSR and testing. For these purposes any effector app need to have root domain. Usually we just manually update declarations. For example, from createEvent to rootDomain.createEvent. It takes time. effector-root provides you the possibility to have all units attached to the root domain without any manual actions.

Usage

  1. Replace all imports of effector to effector-root. You can do it by yourself or with babel plugin

  2. To retrieve our app root domain we need just to import it.

import { root, createEvent, attach, fork } from 'effector-root';

Create React App and macros support

Replace all imports of effector to effector-root/macro to automatically add sid:

import { root, createEvent, attach, fork } from 'effector-root/macro';

Note: babel-plugin-macros do not support import * as name, so Your import import * as effector from 'effector-root/macro won't work

Compat

You can easily use effector/compat in your application with effector-root, just:

import { root, createEvent, attach, fork } from 'effector-root/compat';

Note: root domain from effector-root/compat is not the same domain as from effector-root

root's People

Contributors

dependabot[bot] avatar sergeysova avatar yanlobat avatar zerobias avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.