Comments (1)
@anatoliyklamerdataart I'll put a link in the readme to the pipeline spec, which contains a lengthy example.
That said, depending on what you want to do with chancejs, you can probably avoid pipelines.
If you want to use chancejs to generate random values on each iteration you should be able to just use it inside of your generator, something like:
Sync.makeFactory({
prop: Sync.each(_ => chance.bool())
});
Of course you could define re-usable helpers so you can do something like
Sync.makeFactory({
prop1: ChanceGen.bool(), // returns Generator<boolean>
prop2: ChangeGen.name()
});
In fact I think maybe you can:
const ChanceGen = mapValues(chance, f => Sync.each(_ => f());
and get all chance functions in one go.
from factory.ts.
Related Issues (20)
- Getting type error with typescript 3.4.1 (and later) using combine HOT 4
- How to randomize buildList results HOT 5
- [Feature request]: makeFactory accepts function parameter HOT 3
- [feature proposal] Allow to specify factory as field default value of another factory HOT 1
- Use value from another field HOT 5
- Current state of the library HOT 2
- Node version bump causes install to fail HOT 2
- Can't use Factory.each to custimize value of build HOT 1
- Derivation using the existing value HOT 2
- Feature request: `create` and `createList`
- Feature request: `resetAllSequenceNumbers`
- Feature request: pass to makeFactory function that returns Builder instead object Builder HOT 1
- This repo does not seem maintained anymore HOT 2
- Combine factories with optional field HOT 3
- Pipelines as generators HOT 1
- Question: How to create a factory outputs tuples? HOT 1
- Failed to parse source maps HOT 1
- How to randomise nested object key in `buildList` HOT 1
- Default merging of objects within factories?
- Possible to allow "transient" values? HOT 1
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 factory.ts.