Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update transduce to Official Transformer Protocol #114

Closed
kevinbeaty opened this issue Apr 4, 2015 · 3 comments · Fixed by #115
Closed

Update transduce to Official Transformer Protocol #114

kevinbeaty opened this issue Apr 4, 2015 · 3 comments · Fixed by #115
Milestone

Comments

@kevinbeaty
Copy link

Change transducers implementation to support "Official Transformer Protocol" discussed in cognitect-labs/transducers-js#20 . Both transducers.js and transducers-js have been updated to support it.

Summary of changes:

// anywhere you use a transformer
// (including transducer implementations)
var xf = {
   init: function()
   step: function(acc, item)
   result: function(acc)
}
// becomes
var xf = {
   '@@transducer/init': function()
   '@@transducer/step': function(acc, item)
   '@@transducer/result': function(acc)
}
// reduced wrapper object changes from 
{
   value: acc,
   __transducers_reduced__: true
}
// to
{
   '@@transducer/value': acc,
   '@@transducer/reduced':true
}
@briancavalier
Copy link
Member

Awesome, thanks for the heads up, @kevinbeaty! Do you think it's worth supporting both protocols for some period of time? It looks like it'd be easy.

I should actually have time to get this done I've the weekend.

@kevinbeaty
Copy link
Author

@briancavalier I don't know if it's worth it as transducers-js, transducers.js and others already published the updated API without backwards compatibility. It's technically a breaking change though, so it's really your call

@briancavalier
Copy link
Member

@kevinbeaty Ok, cool. I think I'll support both, but only for a short period. Pull request coming soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants