Comments (3)
That does work. Sorry, to clarify, instead of a concrete type like ItemType
in your example, I want it to be generic. So that the logic can work with any type. So one place where the logic is used it might work with strings, other places might work with numbers, etc.
from kea.
I just wrapped it in a factory function and
export const getSomeLogic = <T>() => {
return kea<SomeLogicType<T>>({
const logic = getSomeLogic<Foo>()();
from kea.
That's a clever trick!
Not sure why it doesn't work for you though.
from kea.
Related Issues (20)
- Documentation gap for keyed logic files with paths HOT 3
- Passing MakeLogicType into the `.extend` API HOT 3
- Error: [KEA] Can not find path "kea.inline.2.01F5GZMSKVYQS0SD7M823JDN8P" in the store. HOT 2
- Unit Test in 2.4 HOT 1
- pass component props to logic HOT 3
- BindLogic + automatic connections support? HOT 4
- ListenerFunction’s Typescript return type should be " any | Promise<any>" HOT 1
- could Redux be separate from kea? HOT 1
- Using parameters when getting values? HOT 2
- Still having issues to unit test connected components HOT 1
- Using equality comparison in selectors HOT 4
- Updating part of connected logic HOT 2
- Accessing whole state in reducers HOT 1
- Update instructions for Next.js support with SSR HOT 2
- How to test `propsChanged` ? HOT 1
- Kea does not unmount logic when using lazy components with suspense HOT 3
- When will the translation of the document begin? HOT 1
- Link in About on GitHub repo is dead HOT 1
- How to do something like router.pop() HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kea.