Comments (8)
Just implement depject in depject, then you could plug your own apply modules in
Not sure if I'm joking or if this is actually a good idea
Goes away and implements meta-depject package
from depject.
We could have a "raw" mode or something where you just get the array of sockets, and can call them your self, but I am curious what exactly that way to call them is and how you are using it.
depject is a very fundamental part, that forms the central architecture of the application you build with it, therefor it's extremely important to fight for elegance - to do that, we need a good map of the battlefield - which is how you actually intend to use it
from depject.
@dominictarr "raw" would work, but i find the above proposal to be more elegant, since it means you could replace the string 'first' with the function require('depject/apply').first
and it'd be the same.
how i intend to use it is exactly above. currently i can't depject-ify my inu/entry
code used here in catstack
because i need to be able to do something like the above.
the only downside i imagine so far is that you couldn't have a depject-able apply function, since you need the apply function when creating the module so can't "need" it. but i'm not sure why you'd want that behavior.
from depject.
you'd just have a function that worked like raw
did, then apply another one (which probably works like first)
@ahdinosaur can you describe how your reduce
and many
work though?
from depject.
@dominictarr sure. they're very specific to what i'm doing:
- inu/lib/reduce: takes many
(model, action) => ({ model, effect })
functions and combines them to a single function of the same signature. - inu/lib/many: takes many
(model, effect, sources) => pull.values(actions)
functions and combines them to a single function of the same signature.
from depject.
@ahdinosaur I'm a little worried that is streams overkill, not everything is a stream.
other than that, is the main difference here that everything in catstack takes 3 arguments? (model, effect, sources)
?
from depject.
I'm a little worried that is streams overkill, not everything is a stream.
yeah, i'm thinking about re-writing inu to use observables, but those are streams too. 😉
other than that, is the main difference here that everything in catstack takes 3 arguments?
(model, effect, sources)
?
no. inu
is the client-side state machine for catstack
, and an inu
store can have a run
function which takes that signature, which is the only place it happens.
from depject.
@ahdinosaur so I'm not suggesting you do this, but building this into a custom depject makes it a bit harder to see what is happening. Hypothetically, if instead you just called it with a catstack function what would that function look like?
catstack(depject.method)(model, effect)
what would catstack look like? would it just be pull-many on a depject map?
from depject.
Related Issues (19)
- idea: depject image manipulation app based around canvas HOT 4
- module terminology HOT 2
- overriding give/needs on a specific module
- idea: depject app as script tags HOT 4
- gives and needs sugar HOT 7
- better error message for when needs: true
- [apply] super / extend / around HOT 3
- has anyone used reduce yet? HOT 12
- combinatorials HOT 6
- better error message when created plug is not a function HOT 1
- dynamic modules HOT 8
- A needed module that returns a number returns undefined if the number is zero HOT 1
- should `combine` and `first` order be reversed? HOT 7
- Using reduce for decorators HOT 11
- module path override is undocumented HOT 8
- a silly idea: frameworks and plug paths as files paths
- examples make no sense HOT 1
- asynchronous create functions? HOT 2
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 depject.