mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-02-13 22:29:45 +08:00
Summary: @public
This diff does a couple of things:
- Move all the code in a src/ folder
- Move bezier.js in the Animated folder
- Rename Animated.js into AnimatedImplementation.js and adds two entry points: AnimatedReactNative.js and AnimatedWeb.js
- Implement very dumb polyfills for flattenStyle, Set and InteractionManager
- Import my work in progress demo.html file to make sure that the code is actually working.
Everything is not working correctly:
- It calls forceUpdate on every frame and doesn't use bindings because setNativeProps is not implemented
- None of the style: {transform} are working because React web doesn't know about the array notation for transform
- The demo need more work
Reviewed By: @sahrens
Differential Revision: D2464277
27 lines
595 B
JavaScript
27 lines
595 B
JavaScript
/**
|
|
* Copyright (c) 2015-present, Facebook, Inc.
|
|
* All rights reserved.
|
|
*
|
|
* This source code is licensed under the BSD-style license found in the
|
|
* LICENSE file in the root directory of this source tree. An additional grant
|
|
* of patent rights can be found in the PATENTS file in the same directory.
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
function SetPolyfill() {
|
|
this._cache = [];
|
|
}
|
|
|
|
SetPolyfill.prototype.add = function(e) {
|
|
if (this._cache.indexOf(e) === -1) {
|
|
this._cache.push(e);
|
|
}
|
|
};
|
|
|
|
SetPolyfill.prototype.forEach = function(cb) {
|
|
this._cache.forEach(cb);
|
|
};
|
|
|
|
module.exports = SetPolyfill;
|