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

Change to Official Transformer Protocol #1003

Closed
kevinbeaty opened this issue Apr 4, 2015 · 1 comment
Closed

Change to Official Transformer Protocol #1003

kevinbeaty opened this issue Apr 4, 2015 · 1 comment
Assignees

Comments

@kevinbeaty
Copy link
Contributor

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 (my libraries to follow soon).

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
}

Obviously, there is room to generalize this. This may be a good opportunity to reduce the redundancy and consider other transducer implementation strategies (other than .prototype) as @CrossEye and @megawac brought up in the initial transducers PR

@buzzdecafe buzzdecafe self-assigned this Apr 4, 2015
@CrossEye
Copy link
Member

CrossEye commented Apr 4, 2015

I do love interoperability! 😄

CrossEye added a commit that referenced this issue Apr 5, 2015
update to transducer protocol. fixes #1003
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants