Giter Club home page Giter Club logo

effector-factorio's People

Contributors

kelin2025 avatar koninmikhail avatar tplk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

effector-factorio's Issues

Can't install package via npm

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/effector
npm ERR!   effector@"^22.8.7" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer effector@"^22 | ^23" from [email protected]
npm ERR! node_modules/effector-factorio
npm ERR!   effector-factorio@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\konin.mv\AppData\Local\npm-cache\_logs\2023-12-12T10_26_39_333Z-eresolve-report.txt

npm ERR! A complete log of this run can be found in: C:\Users\konin.mv\AppData\Local\npm-cache\_logs\2023-12-12T10_26_39_333Z-debug-0.log

Why `model` prop is passed to original view component?

Hi. Why model prop is passed to original view component?
This is needed only for types?
Because I wasn't expected to receive it alongside with my component props.

const FeatureComponentSelect = modelView(factory, (props: SelectProps) => { const model = factory.useModel(); // some code inside return <Select {...props} /> })

So in the DOM I have model prop passed.
So this is a problem, and I need somehow to make 2 steps to solve this issue

  1. every type of component wrapper I need to mix to something like this
    props: SelectProps & { model: ReturnType<typeof factory.useModel> }
  2. if component passed rest props with spread, every time you need to extract model prop from it

So, my question is - why you pass model prop to original component if you never use it (model is always is extracted through factory.useModel hook)

My suggestion is to separate viewProps from model like this

 const { model, ...viewProps } = props;

Вопрос по использованию в связке с effector/babel-plugin

Привет. Возник вопрос по тому, какие best practices есть по использованию effector-factorio вместе с effector/babel-plugin, чтобы проставлялись sid юнитам. Если условно у меня есть папка features и в каждой фиче есть фабрика.

Vite conflicts with JSX in sources

Since tsdx does not support "jsx": "react-jsx" in tsconfig.json, I transpile it with babel
However, Vite says React is not defined
To fix this, you can add this to vite.config.ts:

// vite.config.js
import { defineConfig } from 'vite'

export default defineConfig({
  esbuild: {
    jsxInject: `import React from 'react'`
  }
})

But we need to fix it anyway

Add support for `@@unitShape`

https://effector.dev/docs/ecosystem-development/unit-shape-protocol

Looks like it would be very useful to use this protocol with useUnit:

const formFactory = modelFactory((options: FactoryOptions) => {
  const loginChanged = createEvent<string>();
  const passwordChanged = createEvent<string>();
  const submitPressed = createEvent();

  const $login = createStore('');
  const $password = createStore('');

  const $form = combine({ login: $login, password: $password });

  const $disabled = options.registerFx.pending;

  $login.on(loginChanged, (prev, next) => next);
  $password.on(passwordChanged, (prev, next) => next);

  sample({
    source: $form,
    clock: submitPressed,
    target: options.registerFx,
  });

  return {
    $login,
    $password,
    $disabled,
    loginChanged,
    passwordChanged,
    submitPressed,
  };
});

const form = formFactory({ registerFx })

function App() {
  const { login, password, disabled, loginChanged, passwordChanged, submitPressed } = useUnit(form)
}

But I think it will be very useful to remove $ from the prefix.

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.